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 CLM history variables

mizukami

New Member
Hi,

I am trying to output many variables in history files. These are PET (potential evapotranspiration), QFLX_SUB_SNOW (snow sublimation rate), RAM1 (aerodynamical resistance), Rnet (net radiation). I included these namelists in clm.buildnml.csh. However, I was not able to output these variables (got error).

I suspect these are not in default namelist (though it is listed in CLM documents). If so, I would like to know how to put these variables in namelists. I cannot find information on this.

thanks for help
naoki
 

slevis

Moderator
Staff member
Looking at histFldsMod.F90, I see the problem with PET: it is within the #if (defined CASA) code, at least in my version of the code. You'd have to move it outside the if-block to see this variable in history.

The other variables of interest are listed as 'inactive'. If for some reason you are having trouble making these active using the namelist, then you could remove the piece that says default='inactive' in histFldsMod.F90, compile, and I hope that this would work.

Sam Levis
 

mizukami

New Member
Hi,
I tried modifying the source code to output PET and QFLX_XUB_SNOW. I am getting error as follows
++++++++++++++++++++++++++++++++++++++++++++++++++++++
htapes_fieldlist ERROR: QFLX_SUB_SNOW in fincl( 19 )
for history tape 2 not found
ENDRUN: called without a message string
++++++++++++++++++++++++++++++++++++++++++++++++++++++

What I did is
1. Copied histFldsMod.F90 from CESM root to ../cesm1_0_3/scripts/$CASE/SourceMods/src.clm

2. In copied source code, I removed "default='inactive'" from the following lines for QFLX_SUB_SNOW (just follow the instruction)

"call hist_addfld1d (fname='QFLX_SUB_SNOW', units='mm H2O/s', &
avgflag='A', long_name='sublimation rate from snow pack', &
ptr_pft=clm3%g%l%c%p%pwf%qflx_sub_snow, default='inactive')"

3. I also moved PET outside #if (defined CASA) and removed "default='inactive'"

4. compiled.

Do I have to modify anything in histFileMod.F90? I saw subroutine called hist_addfld1d

Thanks!
naoki
 

slevis

Moderator
Staff member
First a question:
Are you running with CN active? If not, QFLX_SUB_SNOW may be within the #if (defined CN) code, just as PET was within the #if (defined CASA) code. Please look at the code carefully and identify all the #if (defined ...) options that may be affecting you; not just the ones that I thought to mention to you.

Otherwise, when you're at a loss, here's a strategy that often helps when you're debugging:
Start over and make one change at a time. For example, first remove "default='inactive'" from QFLX_SUB_SNOW, then compile and run. At this stage, do not even request an auxiliary history file and see if the new variable appears in the h0 files. Then request an aux history file and see if that works. Then move on to the next variable. If you make one change at a time, then you know what to focus on, instead of wondering which change caused the problem.

Sam

naoki said:
Hi,
I tried modifying the source code to output PET and QFLX_XUB_SNOW. I am getting error as follows
++++++++++++++++++++++++++++++++++++++++++++++++++++++
htapes_fieldlist ERROR: QFLX_SUB_SNOW in fincl( 19 )
for history tape 2 not found
ENDRUN: called without a message string
++++++++++++++++++++++++++++++++++++++++++++++++++++++

What I did is
1. Copied histFldsMod.F90 from CESM root to ../cesm1_0_3/scripts/$CASE/SourceMods/src.clm

2. In copied source code, I removed "default='inactive'" from the following lines for QFLX_SUB_SNOW (just follow the instruction)

"call hist_addfld1d (fname='QFLX_SUB_SNOW', units='mm H2O/s', &
avgflag='A', long_name='sublimation rate from snow pack', &
ptr_pft=clm3%g%l%c%p%pwf%qflx_sub_snow, default='inactive')"

3. I also moved PET outside #if (defined CASA) and removed "default='inactive'"

4. compiled.

Do I have to modify anything in histFileMod.F90? I saw subroutine called hist_addfld1d

Thanks!
naoki
 

mizukami

New Member
Hi Sam, Thanks for advice,

I am running CLM in off-line mode (compset I4804), so my understanding is that CN biochemistry is inactive. My interest is retrospective hydrologic simulation with various atmospheric forcing data to look at forcing data impact on hydrologic simulations.

I am compiling with one-by-one small code modification. I did not understand what each if-statement indicated before. Now I am able to output QFLX_SUB_SNOW by moving hist_addfld1d statement for that variable outside any if-statement (after some variables that are already output in default). Only one variable I have problem with is PET. Just like QFLX_SUB_SNOW, I moved hist_addfld1d call for PET outside any if statement, and I am getting error message

PGF90-S-0142-pet is not a member of this RECORD

I thought I would need to move it somewhere else? or am I missing anything?

thanks!
naoki
 

mizukami

New Member
I am able to compute PET manually with several variables that are inactive in default (aerodynamic resistance, net radiation, leaf stomatal resistance etc. ). I was able to output all of them. so the my problem is solved for now. thank you for all the help.

I am just wondering why only PET give me a trouble if trying to activate for output. and who could give possible reasons so i could look into.

naoki
 

mizukami

New Member
oops, i think I posted my previous question before looking at Jim's. I am sorry,

I just copied and pasted the following to move outside the if-statement

call hist_addfld1d (fname='PET', units='mm h2o/s', &
avgflag='A', long_name='Potential Evapotranspiration', &
ptr_pft=clm3%g%l%c%p%pps%pet, set_lake=0._r8)

I will look at the code carefully. might be variable name "pet" is not used?
 
Top