how to output a user-defined variable to tavg output files in POP2

Hi, everyone,I have made some modification in ocn_comp_mct.F90 of POP2 to replace the first layer of ocean temperature (tm) by observed  sea surface temperature (to) in each model step.Now, I also want to calculate the difference td (td = tm -to) in each model step before replacement and output this variable as other variables, such as T, UVEL. I searched on the internet, and found that if the variable is a model variable, it is easy to do (http://www.cesm.ucar.edu/models/cesm1.2/pop2/doc/faq/#nml_general_change, How do I add a POP2 variable to the tavg output files? Case 3 -- no code support exists). But for my case, the variable is not a model variable, is defined by myself, so how to output this variable as normal tavg output files? Thanks very muchBest,Fengfei
 

njn01

Member
You can follow the instructions http://www.cesm.ucar.edu/models/cesm1.2/pop2/doc/faq/#dev_tavg_add3to do what you want to do. You will need to add your own model variables to store and compute the quantities you want to put out onto the "tavg" output files. Because your code mods are in ocn_comp_mct, this may be more difficult than adding tavg variables in the main POP code, but it is not impossible, I think.  Be sure to add "use tavg" to ocn_comp_mct.F90, because it is not there by default and you will need it to support your mods.
 
Back
Top