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

How to modify the source code?

XinhaoSuo

Xinhao Suo
Member
Hi,
Recently I have been trying to modify some of the CLM code to see the impact on the results.
I was interested in soil carbon, so I tried to deal with the decomposition of soil carbon, and I did a simple test.
Created a CASE - I2000Clm50Cn first, and then I copied SoilBiogeochemDecompCascadeBGCMod. F90 files into the $CASE/SourceMods/src.clm, add a variable for i_s3s42, and add the code:
i_s3s4 = 6
decomp_cascade_con%cascade_step_name(i_s3s4) = 'S3S4'
rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s3s4) = rf_s3s4*0.4
cascade_donor_pool(i_s3s4) = i_soil3
cascade_receiver_pool(i_s3s4) = i_soil4
pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s3s4) = 1.0_r8

i_s3s42 = 10
decomp_cascade_con%cascade_step_name(i_s3s42) = 'S3S42'
rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s3s42) = rf_s3s4*0.6
cascade_donor_pool(i_s3s42) = i_soil3
cascade_receiver_pool(i_s3s42) = i_soil4
pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s3s42) = 1.0_r8

My approach is to divide Soil4 into two, and then adjust their proportion respectively, but in this step seems to be wrong, this is because my source code modification has a problem? (It works fine without adding this code). I have posted my modification code and error information below, is there anyone who can discuss this problem with me

run command is mpiexec -n 128 /home/user/Formal/I4/bld/cesm.exe >> cesm.log.$LID 2>&1
Exception from case_run: ERROR: RUN FAIL: Command 'mpiexec -n 128 /home/user/Formal/I4/bld/cesm.exe >> cesm.log.$LID 2>&1 ' failed
See log file for details: /home/user/Formal/I4/run/cesm.log.231126-053343
Submit job case.st_archive
Starting job script case.st_archive
st_archive starting
moving /home/user/Formal/I4/run/cpl.log.231126-052440 to /home/user/archive/I4/logs/cpl.log.231126-052440
moving /home/user/Formal/I4/run/glc.log.231126-052440 to /home/user/archive/I4/logs/glc.log.231126-052440
moving /home/user/Formal/I4/run/cesm.log.231126-052440 to /home/user/archive/I4/logs/cesm.log.231126-052440
moving /home/user/Formal/I4/run/rof.log.231126-052440 to /home/user/archive/I4/logs/rof.log.231126-052440
moving /home/user/Formal/I4/run/atm.log.231126-053343 to /home/user/archive/I4/logs/atm.log.231126-053343
moving /home/user/Formal/I4/run/atm.log.231126-052440 to /home/user/archive/I4/logs/atm.log.231126-052440
moving /home/user/Formal/I4/run/cesm.log.231126-053343 to /home/user/archive/I4/logs/cesm.log.231126-053343
moving /home/user/Formal/I4/run/lnd.log.231126-052440 to /home/user/archive/I4/logs/lnd.log.231126-052440
moving /home/user/Formal/I4/run/cpl.log.231126-053343 to /home/user/archive/I4/logs/cpl.log.231126-053343
moving /home/user/Formal/I4/run/lnd.log.231126-053343 to /home/user/archive/I4/logs/lnd.log.231126-053343
Cannot find a I4.cpl*.r.*.nc file in directory /home/user/Formal/I4/run
Archiving history files for datm (atm)
Archiving history files for clm (lnd)
Archiving history files for mosart (rof)
Archiving history files for cism (glc)
moving /home/user/Formal/I4/run/I4.cism.initial_hist.2000-01-01-00000.nc to /home/user/archive/I4/glc/hist/I4.cism.initial_hist.2000-01-01-00000.nc
Archiving history files for drv (cpl)
Archiving history files for dart (esp)
st_archive completed
Submitted job case.run with id None
Submitted job case.st_archive with id None
 

Attachments

  • SoilBiogeochemDecompCascadeCNMod.txt
    42.1 KB · Views: 1
  • cesm.txt
    92.3 KB · Views: 1

XinhaoSuo

Xinhao Suo
Member
Oh...It seems that I also need to modify the cascade_receiver_pool and the ndecomp_caascade_transitions in clm_varpar
 
Top