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

Output Slab Ocean Model history on pop grid

Dear Forum,I wondered if there's a way to get SOM output on pop grid.For example, in docn_comp_mod.F90 there is a variable somtp, which I guess is SOM temprature and is on pop grid (i.e. gx3v7 in my case).So my question is, how to write out the somtp history in a netcdf file?I searched and found subroutines like addfld, add_default and outfld, but they seem to work on CAM component only.There's also a history.F90 in ./models/ocn/pop2/source/ , but I have no idea how to use it.Will you please help?Thanks
 

dbailey

CSEG and Liaisons
Staff member
There are two ways to do this. You can get the coupler to write history files using the AVGHIST_OPTION and AVGHIST_N variables for averaged history files or HIST_OPTION and HIST_N for snapshot files. Otherwise, you can get the sea ice component (CICE) to write out sst. The coupler history file variables are in env_run.xml, while the CICE one is in the CICE namelist (f_sst). Depending on the version, this is either cice.buildnml.csh or user_nl_cice. Documentation for these options are here:Coupler history:http://www.cesm.ucar.edu/models/cesm1.2/cesm/doc/modelnl/env_run.html#run_start_varsCICE history:http://www.cesm.ucar.edu/models/cesm1.2/cice/doc/node31.html
 
Thanks David, for the quick response.I checked my model, which is SOM+CAM5 (CESM1_2_2, E_compset), there’s no output file under cpl/hist/, but there are output files under ice/hist/.So I guess writing SOM output in CICE history files would be plausible.An outline of procedures I can think of to, for example, write the somtp variable in docn_comp_mod.F90 to CICE history files, would be:1. Add a new state ‘my_somtp’ that is passed from the ocean to CICE. This is done by namelist:&seq_flds_user cplflds_custom = 'So_my_somtp->o2x', 'So_my_somtp->x2i’/2. Assign somtp values to my_somtp;3. Since CICE field list does not have my_somtp, need to add my_somtp in ice_history_fields.F90 and in ice_history.F90, copy them to $CASEROOT/SourceMods/src.cice/4. Include fincl1 = ‘MY_SOMTP’ in user_nl_cice. Build and run.Am I following the right path?Thanks 
 

dbailey

CSEG and Liaisons
Staff member
You should probably read the FAQ. For the SOM, the somtp is assumed to be the same as SST. Hence you just write f_sst from the CICE, which is there already.

https://bb.cgd.ucar.edu/faq-data-ocean-slab-mode-docn-somDave
 

dbailey

CSEG and Liaisons
Staff member
I see now. This is something that is not supported in the CESM. However, you might be able to workaround it two ways:1. Hack the coupler code to receive a new flux from the DOCN. Then this could be written to the coupler history file.2. The DOCN is able to write instantaneous restart files. These might be sufficient, but you could also hack this code to write history files instead.Good luck.Dave
 
Hi Dave,Sorry about the confusion. What I’m really doing is to apply relaxation to SOM temperature, record restoring heat fluxes due to restoring term, and generate a Q-flux from the recorded restoring heat.So far I’m able to modify docn_comp_mod.F90 to carry out the relaxation and calculate restoring heat flux.But I don’t know how to output the heat flux since it’s a new user-defined variable.I mentioned somtp just as an example. Looks like I picked a bad example.  Zaiyu
 
Thanks Dave.Now I have set AVGHIST_OPTION=nmonths and AVGHIST_N=1, run the model (E compset) for 1 year.But still there's no output files in ./cpl/hist/Am I missing something, or cpl history is not available for E compset?Thanks again
 
Just a comment on the cpl history average issue above.With AVGHIST_OPTION=nmonths and AVGHIST_N=1 in env_run.xml, even after rebuild, however, cpl.log shows:(seq_timemgr_clockInit) histavg_option = never(seq_timemgr_clockInit) histavg_n      =       -999When added below options in user_nl_cpl:&seq_timemgr_inparm histavg_n = 1 histavg_option = 'nmonths'The issue is solved.
 
Top