Issue with Adding irrigation_method to histfile in CTSM

Status
Not open for further replies.

bixby

Jonghyeok Lee
New Member
Hello CTSM community,

I have recently applied the changes from Add flood irrigation and surface water ponding for rice paddies by YiYaoVUB · Pull Request #2026 · ESCOMP/CTSM on GitHub to my CTSM setup and the model seems to run smoothly.
However, I am keen on inspecting the newly introduced variable irrigation_method (source: Yao et al., 2022) in the surfdata_map and wish to add it to the histfile for further analysis.

To achieve this, I utilized call hist_addfld2d for the addition.
Although the variable was successfully added to the histfile, the resulting values seem to be off.
I have experimented with both avgflag options 'A' and 'I', and tried using ptr_col, gcell, lnd, and patch

(I personally believe ptr_lnd is the correct choice, as in surfrdMod.F90 the dimension name is set as dim1name=grlnd:

if ( cft_size > 0 )then
call ncd_io(ncid=ncid, varname='irrigation_method', flag='read', data=irrig_method, &
dim1name=grlnd, readvar=readvar)

For reference and to possibly aid in troubleshooting, I am attaching the resulting histfiles, the surfdata_map file, and the modified IrrigationMod.F90.

I would greatly appreciate any insights or suggestions on how to correctly implement and analyze the irrigation_method variable in the histfile.

Thank you in advance for your help!
 

Attachments

  • irrigation_method_2d_patch.png
    irrigation_method_2d_patch.png
    259 KB · Views: 6
  • irrigation_method_2d_lnd.png
    irrigation_method_2d_lnd.png
    111 KB · Views: 5
  • irrigation_method_2d_gcell.png
    irrigation_method_2d_gcell.png
    106.3 KB · Views: 3
  • irrigation_method_2d_col.png
    irrigation_method_2d_col.png
    114.9 KB · Views: 4
  • irrigation_method_1dpatch.png
    irrigation_method_1dpatch.png
    329.7 KB · Views: 6
  • version_info.txt
    version_info.txt
    8.2 KB · Views: 4

oleson

Keith Oleson
CSEG and Liaisons
Staff member
I'm not that familiar with that code but I think I would put a call in subroutine IrrigationInitHistory in IrrigationMod.F90:

this%irrig_method_patch(begp:endp) = spval
call hist_addfld1d (fname='IRRIG_METHOD', units='??', &
avgflag='A', long_name='irrigation method', &
ptr_patch=this%irrig_method_patch)

irrig_method is a patch-level variable there.
 

bixby

Jonghyeok Lee
New Member
I'm not that familiar with that code but I think I would put a call in subroutine IrrigationInitHistory in IrrigationMod.F90:

this%irrig_method_patch(begp:endp) = spval
call hist_addfld1d (fname='IRRIG_METHOD', units='??', &
avgflag='A', long_name='irrigation method', &
ptr_patch=this%irrig_method_patch)

irrig_method is a patch-level variable there.
Thanks! Oleson.

Unfortunately, I already tried it, but "this%irrig_method_patch" is the integer and hist_addfld1d does not get an integer as input.
================================================
Line 684: this%irrig_method_patch(begp:endp) = spval

/home/chris3909/CESM2/components/clm/src/biogeophys/IrrigationMod.F90(684):
error #6906: The value of the integer is either too great or too small, and overflow/underflow occurred. [1.E36]


Line 687: ptr_patch=this%irrig_method_patch

/home/chris3909/CESM2/components/clm/src/biogeophys/IrrigationMod.F90(687):
error #6633: The type of the actual argument differs from the type of the dummy argument. [IRRIG_METHOD_PATCH]
================================================

So, I convert it to real(r8), and then applied hist_addfld1d as you mentioned, but still shown like my previous figure that I attached.
 

slevis

Moderator
Staff member
To troubleshoot, it may be helpful to find a history field that works and then write out to text files the contents of the two arrays: the one that works and the one that doesn't. This may offer insight into what is different and why one works and the other does not.
 
Last edited:
Status
Not open for further replies.
Back
Top