Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Adding New output variables

Hi

I want to add CGH to the history files. According to section 4.2 of CAM user's guide, it reads "If the field is in the Master Field
List (see Table 3.1), the user must ensure that there is an uncommented outfld call for that field and must also add it to the history output via namelist variable(s) FINCL(1-6)."

That means all the variables described in Table 3.1 are already has format for "call outfld" ??? I searched for such a format in the directory "cam1/models/atm/cam/src/physics/cam1", but could not find it.

However I made up the call outld format as

"call outfld ('CGH', cgh, pcols, lchnk)" in vertical_diffusion.F90.

and also make sure that namelist variable set to FINCL1='CGH:A'.

also make sure in history.F90 file,
call addfld ('CGH ','K/m ',pverp,'A','Counter-gradient term for heat in PBL',phys_decomp)


However the program crashes giving the below message:

"cam1/models/atm/cam/src/physics/cam1/vertical_diffusion.F90", 1516-036 (S) Entity cgh has undefined type.
** vertical_diffusion === End of Compilation 1 ===
1501-511 Compilation failed for file vertical_diffusion.F90.


Can anybody tell me whether my format of "call outfld ('CGH', cgh, pcols, lchnk)" in vertical_diffusion.F90 is right? If not can suggest me what is the suitable one?

thanks alot
bala
 

bundy

New Member
It looks like you have done the addfld & outfld calls right. But since it still isn't working, are you sure you have the outfld call in the right subroutine?

The error message indicates that you might have the outfld call in a subroutine that doesn't know about cgh. Make sure the outfld call is in subroutine vertical_diffusion_tend.

And the addfld call should be in an initialization subroutine (only run once at startup, not every timestep). It is fine in history.F90:bldfld(), for instance (cam3.1- it may be different in the version of the model you are running). You can also put the addfld call in the initialization routine in vertical_diffusion.F90: vertical_diffusion_init().
 
Top