Skip to content
Merged
14 changes: 12 additions & 2 deletions bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,18 @@ if ($docosp) {
add_default($nl, 'docosp', 'val'=>'.true.');
}

# TEM diags
if ($phys =~ /cam7/) {
add_default($nl, 'ctem_diags_numlats');
}
# check for conflicting TEM diagnostics settings
if ((defined $nl->get_value('ctem_diags_numlats')) and (defined $nl->get_value('phys_grid_ctem_za_nlat'))) {
my $esmf_nlats = $nl->get_value('ctem_diags_numlats');
my $sphr_nlats = $nl->get_value('phys_grid_ctem_za_nlat');
if ($esmf_nlats>0 and $sphr_nlats>0) {
die "Cannot set both Spherical Harmonics and ESMF regrid methods of TEM zonal mean diagnostics.\n";
}
}

# Constituents
# ============
Expand Down Expand Up @@ -3123,7 +3135,6 @@ else {
# present in the namelist.
add_default($nl, 'use_hemco');
if ($nl->get_value('use_hemco') =~ m/$TRUE/io) {
add_default($nl, 'cam_physics_mesh');
add_default($nl, 'hemco_data_root');
add_default($nl, 'hemco_config_file');
add_default($nl, 'hemco_diagn_file');
Expand Down Expand Up @@ -3211,7 +3222,6 @@ if ($waccmx) {
add_default($nl, 'fv_high_altitude', 'val'=>'.true.');
}
if ($ionos ne 'none') {
add_default($nl, 'cam_physics_mesh');
add_default($nl, 'oplus_grid');
add_default($nl, 'edyn_grid');
}
Expand Down
16 changes: 4 additions & 12 deletions bld/namelist_files/namelist_defaults_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -959,18 +959,10 @@
<edyn_grid hgrid="0.47x0.63">320x385</edyn_grid>
<edyn_grid hgrid="ne120np4" >320x385</edyn_grid>

<!-- ESMF mesh files for physics decomposition -->
<cam_physics_mesh hgrid="0.47x0.63">atm/cam/coords/fv0.47x0.63_esmf_c210305.nc</cam_physics_mesh>
<cam_physics_mesh hgrid="0.9x1.25">atm/cam/coords/fv0.9x1.25_esmf_c210305.nc</cam_physics_mesh>
<cam_physics_mesh hgrid="1.9x2.5">atm/cam/coords/fv1.9x2.5_esmf_200428.nc</cam_physics_mesh>
<cam_physics_mesh hgrid="4x5">atm/cam/coords/fv4x5_esmf_c210305.nc</cam_physics_mesh>
<cam_physics_mesh hgrid="ne5np4">atm/cam/coords/ne5np4_esmf_20191204.nc</cam_physics_mesh>
<cam_physics_mesh hgrid="ne5np4" npg="3">atm/cam/coords/ne5np4.pg3_esmf_mesh_c210121.nc</cam_physics_mesh>
<cam_physics_mesh hgrid="ne16np4">atm/cam/coords/ne16np4_esmf_c210305.nc</cam_physics_mesh>
<cam_physics_mesh hgrid="ne16np4" npg="3">share/meshes/ne16pg3_ESMFmesh_cdf5_c20211018.nc</cam_physics_mesh>
<cam_physics_mesh hgrid="ne30np4">atm/cam/coords/ne30np4_esmf_c210305.nc</cam_physics_mesh>
<cam_physics_mesh hgrid="ne30np4" npg="3">atm/cam/coords/ne30pg3_esmf_20200428.nc</cam_physics_mesh>
<cam_physics_mesh hgrid="ne120np4" npg="3">share/meshes/ne120pg3_ESMFmesh_cdf5_c20211018.nc</cam_physics_mesh>
<!-- For ESMF regrid zonal-mean TEM diagnostics -->
<ctem_diags_numlats>0</ctem_diags_numlats>
<ctem_diags_numlats hgrid="ne16np4">90</ctem_diags_numlats>
<ctem_diags_numlats hgrid="ne30np4">180</ctem_diags_numlats>
Comment thread
cacraigucar marked this conversation as resolved.

<!-- For scaling lightning sources of NOx -->
<lght_no_prd_factor >1.00D0</lght_no_prd_factor>
Expand Down
7 changes: 0 additions & 7 deletions bld/namelist_files/use_cases/1850_trop_strat_t4s_cam7.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,6 @@
'HCFC22', 'N2O', 'CFC114', 'CFC115', 'HCFC141B', 'HCFC142B', 'CH2BR2', 'CHBR3', 'H2402', 'OCS', 'SF6', 'CFC11eq'
</flbc_list>

<!-- TEM -- REMOVE (will be default namelist parms) -->
<!-- cam_physics_mesh = '$ATM_DOMAIN_MESH' -->
<cam_physics_mesh hgrid="ne16np4" npg="3">share/meshes/ne16pg3_ESMFmesh_cdf5_c20211018.nc</cam_physics_mesh>
<cam_physics_mesh hgrid="ne30np4" npg="3">share/meshes/ne30pg3_ESMFmesh_cdf5_c20211018.nc</cam_physics_mesh>
<ctem_diags_numlats hgrid="ne16np4"> 90</ctem_diags_numlats>
<ctem_diags_numlats hgrid="ne30np4">180</ctem_diags_numlats>

<!-- history output -->

<mfilt > 0, 5, 20, 40, 12, 120, 73</mfilt>
Expand Down
4 changes: 4 additions & 0 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def buildnml(case, caseroot, compname):
COMP_INTERFACE = case.get_value("COMP_INTERFACE")
CALENDAR = case.get_value("CALENDAR")
COMPSET = case.get_value("COMPSET")
mesh_file = case.get_value("ATM_DOMAIN_MESH")

# The Gregorian calendar currently can't be used with spinup compsets
# because CAM's stream-handling code can't handle a request for data
Expand Down Expand Up @@ -153,6 +154,9 @@ def buildnml(case, caseroot, compname):
if ninst > 1:
logger.info("%s is being used for cam_branch_file", cam_branch_file)

# ESMF mesh file
infile_lines.append(" cam_physics_mesh = '" + mesh_file + "'")

# In python3 integer division returns a float value.
# Adjust argument of int() to get nearest integer.
dtime = int( (3600*24)/int(atm_ncpl) + .5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ phys_grid_ctem_nfreq=3
phys_grid_ctem_zm_nbas=16
phys_grid_ctem_za_nlat=15
fincl3 = 'Uzm','Vzm','Wzm','THzm', 'VTHzm','WTHzm','UVzm','UWzm'
ctem_diags_numlats=0
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ nhtfrq=9,9,9,9,9,9,9,9,9,9
write_nstep0=.true.
inithist='ENDOFRUN'

cam_physics_mesh = '$ATM_DOMAIN_MESH'
ctem_diags_numlats = 90

fincl2 = 'THtem','Utem','Vtem','Wtem','VTHtem','WTHtem','UVtem', 'UWtem', 'MSKtem', 'PStem'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ phys_grid_ctem_nfreq=-2
phys_grid_ctem_zm_nbas=120
phys_grid_ctem_za_nlat=90
fincl3 = 'Uzm','Vzm','Wzm','THzm', 'VTHzm','WTHzm','UVzm','UWzm'
ctem_diags_numlats=0
12 changes: 6 additions & 6 deletions src/physics/cam/phys_grid_ctem.F90
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ end subroutine phys_grid_ctem_init
!-----------------------------------------------------------------------------
!-----------------------------------------------------------------------------
subroutine phys_grid_ctem_diags(phys_state)
use air_composition, only: cappav
use physconst, only: pref
type(physics_state), intent(in) :: phys_state(begchunk:endchunk)

character(len=*), parameter :: prefix = 'phys_grid_ctem_diags: '
Expand Down Expand Up @@ -260,22 +262,20 @@ subroutine phys_grid_ctem_diags(phys_state)
real(r8) :: wza(nzalat,pver)
real(r8) :: thza(nzalat,pver)

real(r8) :: sheight(pcols,pver) ! pressure scale height (m)
real(r8), parameter :: hscale = 7000._r8 ! pressure scale height (meters)

if (.not.do_calc()) return

do lchnk = begchunk,endchunk

ncol = phys_state(lchnk)%ncol

! scale height
sheight(:ncol,:) = phys_state(lchnk)%t(:ncol,:) * rgas / ( mbarv(:ncol,:,lchnk) * grav ) ! meters

! potential temperature
theta(:ncol,:,lchnk) = phys_state(lchnk)%t(:ncol,:) * phys_state(lchnk)%exner(:ncol,:)
theta(:ncol,:,lchnk) = phys_state(lchnk)%t(:ncol,:) * &
(pref/ phys_state(lchnk)%pmid(:ncol,:))**cappav(:ncol,:,lchnk)

! vertical velocity
w(:ncol,:,lchnk) = -sheight(:ncol,:) * phys_state(lchnk)%omega(:ncol,:) / phys_state(lchnk)%pmid(:ncol,:)
w(:ncol,:,lchnk) = -hscale * phys_state(lchnk)%omega(:ncol,:) / phys_state(lchnk)%pmid(:ncol,:)

u(:ncol,:,lchnk) = phys_state(lchnk)%u(:ncol,:)
v(:ncol,:,lchnk) = phys_state(lchnk)%v(:ncol,:)
Expand Down
Loading
Loading