Question about adding new history output in VOCEmissionMod.F90

Status
Not open for further replies.

Duseong

Duseong Jo
New Member
Hello,

I have been trying to add new history output variables in VOCEmissionMod.F90, but it failed for some reason.

I have attached the html file (compressed to zip file as this forum doesn't allow for me to upload the html file format) that compares the original VOCEmissionMod.F90 on the left and with modification on the right, and the line numbers I will write below are based on the right side.

For GAMMA history output fields (GAMMA, GAMMAT, GAMMAL, GAMMAC, etc.) in CLM, I think those are averaged fields over all PFTs at each grid point, based on subgrid weights using the function hist_update_hbuf and p2g. Please correct me if I misunderstood these GAMMA fields.

So I started to modify the VOCEmissionMod.F90 code, to add GAMMA as a function of PFT, and GAMMA only for the 7th PFT, which is broadleaf_deciduous_temperate_tree (information available at the top of PatchType.F90).

You can see the new pointer variables I added to the vocemis_type (lines #63-73), gamma_out_patch_2d to save GAMMA for all different PFTs, and gamma_out_patch_p7 to save GAMMA for the 7th PFT only. Other changes in the code are highlighted in red with a yellow background.

I have two problems with this code. First, the model stopped at line #716, which I don't understand, as I didn't change any variables in this line:
meg_out(imeg)%flux_out(p) = meg_out(imeg)%flux_out(p) &
+ epsilon * gamma * megemis_units_factor*1.e-3_r8 ! Kg/m2/sec


Second, when I commented out lines for 2D GAMMA values (gamma_out_patch_2d), the model ran successfully, but gamma_p7 values have only a few points that have real numbers globally. I think my if statement is correct for this variable (line #745), maybe I am misunderstanding how CLM divides subgrids into different patches in a landunit and a gridcell.

Any comments will be appreciated, please let me know if there's anything unclear. Thanks!
 

Attachments

oleson

Keith Oleson
CSEG and Liaisons
Staff member
I think it would be much easier to utilize the hist_dov2xy capability to request a new history file that outputs these variables at the pft-level.
For example, for a monthly average of pft-level GAMMA output on a "h1" history file,

hist_dov2xy(2) = .false.
hist_mfilt(2) = 1
hist_nhtfrq(2) = 0
hist_fincl2 = 'GAMMA'
hist_type1d_pertape(2) = 'PFTS'
 

Duseong

Duseong Jo
New Member
I think it would be much easier to utilize the hist_dov2xy capability to request a new history file that outputs these variables at the pft-level.
For example, for a monthly average of pft-level GAMMA output on a "h1" history file,

hist_dov2xy(2) = .false.
hist_mfilt(2) = 1
hist_nhtfrq(2) = 0
hist_fincl2 = 'GAMMA'
hist_type1d_pertape(2) = 'PFTS'
Thank you very much, Keith! I really appreciate your help.
It worked very well, and I could get the subgrid-level pft output, which I could easily convert to the grid cell!
 
Status
Not open for further replies.
Back
Top