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

questions about ADDFLD and OUTFLD usage

hi everyone,     I want to output the values of asdir in /models/atm/cam/src/physics/cam/radsw.F90 in CESM1_2_1 to the output history file .   the following shows what i've done (Bold Font):---------------------------------------------------------------     use rad_solar_var,    only: get_variability   use cmparray_mod,     only: CmpDayNite, ExpDayNite   use quicksort,        only: quick_sort   use phys_control,     only: phys_getopts   use solar_data,       only: sol_tsi, do_spctrl_scaling, ref_tsi   use radconstants,     only: frcsol, ph2o, pco2, po2   use cam_history,      only: addfld, outfld, add_default, phys_decomp...............   ! If night everywhere, return:   if ( Nday == 0 ) then     return   endif call addfld ('SWALBEDO   ',' ',1,    'A','shortwave albedo',phys_decomp) call add_default ('SWALBEDO ', 1 , ' ')! Rearrange input arrays .....  if (scm_crm_mode) then   ! overwrite albedos for CRM      if(have_asdir) asdir = asdirobs(1)      if(have_asdif) asdif = asdifobs(1)      if(have_aldir) aldir = aldirobs(1)      if(have_aldif) aldif = aldifobs(1)   endif    call outfld('SWALBEDO       ',asdir , pcols   ,lchnk   )[/b]!! Perform other initializations.......------------------------------------------------- 

the build was NOT successful.
error in /bld/atm.bldlog is :(shr_sys_abort) ERROR: ADDFLD: Attempt to add field SWALBEDO after history files set   
Could anyone help?thanks :)
 

eaton

CSEG and Liaisons
The calls to addfld and add_default need to go in the  radiation_init subroutine.  These calls need to be made during initialization rather than during the run phase. 
 
Thank you .But I found that there're also some uses of  addfld and add_default  in cam_diagnostics.F90 , which does not include no radiation_init in it.
 

eaton

CSEG and Liaisons
Calls to addfld and add_default need to be made during the model's initialization sequence.  There are many initialization subroutines that are called during this phase.  Each physics parameterization may have an initialization routine.  The dynamical core and other infrastructure utilies may also have initialization subroutine calls.
 
Top