Hi, I want to write a 2D variable to a history file. I'm in PhotosynthesisMod.F90 and have looked at GSSUN for an example of how to do this. Does the following look correct:
In the InitHistory subroutine I add the following, to simply write out data stored in the already existing mbb_patch variable:
Not sure if the first line assigning missing val is necessary but I'm copying the convention I see.
If I wanted to create and write out a completely new variable it looks like I'd have to add that new variable to the photosyns_type structure near the top of the file, e.g.
Thanks.
In the InitHistory subroutine I add the following, to simply write out data stored in the already existing mbb_patch variable:
this%mbb_patch(begp:endp) = spval
call hist_addfld1d (fname='my_var', units='my units', &
avgflag='A', long_name='my long name', &
ptr_patch=this%mbb_patch)
Not sure if the first line assigning missing val is necessary but I'm copying the convention I see.
If I wanted to create and write out a completely new variable it looks like I'd have to add that new variable to the photosyns_type structure near the top of the file, e.g.
real(r8), pointer, private :: my_new_var
. Then fill my_new_var
at the right place. Does this sound right?Thanks.