CAM icon indicating copy to clipboard operation
CAM copied to clipboard

FHS94 with MPASA needs PMID:A output

Open HingOng opened this issue 2 months ago • 6 comments

What is the feature/what would you like to discuss?

FHS94 with MPASA does not output PMID:A by default, but PMID:A is essential for MPASA output. I bypassed this problem by manually added fincl1 = 'PMID:A' to my namelist, but the need to edit the namelist for an essential output is not ideal for future users. Therefore, please update the source code to output PMID:A by default for FHS94 with MPASA.

Is there anyone in particular you want to be part of this conversation?

@adamrher

Will this change (regression test) answers?

No

Will you be implementing this enhancement yourself?

No

HingOng avatar Oct 30 '25 22:10 HingOng

@HingOng can you point me to a h0a file so I can see what is coming out by default?

adamrher avatar Oct 31 '25 00:10 adamrher

@adamrher Here is the path to the h0a file: /glade/derecho/scratch/hxong/f.cam6_4_095.FHS94.mpasa120_mpasa120.deep.000/run/f.cam6_4_095.FHS94.mpasa120_mpasa120.deep.000.cam.h0a.0001-01-31-00000.nc

Also, adding fincl1 = 'PMID:A' to my namelist did not work. The atm.log file says "FLDLST: PMID in fincl(1, 1) not found"

HingOng avatar Oct 31 '25 19:10 HingOng

@kuanchihwang would you mind looking into whether PMID can (or should?) be made available in FHS94 w/ the mpas dycore?

adamrher avatar Oct 31 '25 19:10 adamrher

The problem is PMID and other pressure variables are only being registered and set for the *_moist subroutines in cam_diagnostics.F90, whereas I think this should be done in the *_dry subroutines. I've moved them into the dry calls here:

/glade/derecho/scratch/aherring/cam6_4_106_FHS94_ne30pg3_ne30pg3_mg17_512pes_251103_pmid-test/SourceMods/src.cam/cam_diagnostics.F90

@HingOng can you test whether this works for you? I just tested it in SE and it looks to be working. You don't need to explicitly add it to the tapes either, it should add PMID to fincl1 automatically.

@OkayHughes you'll need this SourceMod to make PMID available in your SE runs.

adamrher avatar Nov 03 '25 17:11 adamrher

Adding more details to what @adamrher wrote.

  1. During CAM initialization, the phys_ctl_readnl subroutine is called to read the phys_ctl_nl namelist group [1], and the cam_physpkg character variable is set to "held_suarez".
  2. The cam_ctrl_set_physics_type subroutine is called, and the moist_physics logical variable is set to .false. for Held-Suarez scheme [2].
  3. Subsequently, when the diag_init subroutine is called to initialize model diagnostics [3][4], moist diagnostics are not initialized due to being guarded behind the conditional on moist_physics.

A proposed fix is to move pmid and maybe other pressure-related variables to dry diagnostics. However, this would constitute a behavior change and CAM is now in freeze mode until release branching. We have to decide if it is acceptable to introduce such behavior change during the freeze window.

@HingOng For now, you can git cherry-pick this commit to fix the reported issue.

kuanchihwang avatar Nov 03 '25 22:11 kuanchihwang

@adamrher @kuanchihwang Thank you for your solutions. I will test them after the NCAR HPC maintenance completes.

HingOng avatar Nov 04 '25 21:11 HingOng

@adamrher I confirm that your SourceMods work with MPAS. @kuanchihwang Your commit looks similar to Adam's SourceMods, so it should work as well.

HingOng avatar Nov 06 '25 22:11 HingOng