20150819: temperature stress disabled in CNPhenologyMod.F90 (see cn.txt) ###The code needs to be checked when the PFT in pftvarcon.F90 is changed (removed, added or reordered). The indices in pftvarcon.F90 are used in the code. added #define CN to the routines: CNGRespMod.F90 (see land01: ~/clm4/cesm1_2_2-testing/point_driver_LDASsa_m3-15_2-CN/notes) L561 in CNPhenolotyMod.F90: we want to use soilt=t_soisno(c,1) instead of soilt=max() in the CN code with CLM4.5. We can run a single point drive with or without that for a tile with seasonal deciduous type to see the difference. Don't need to really locate a tile, just add ityp1_clm=7 ityp2_clm=7 fveg1_clm=1 fveg2_clm=0 after I read in the data (i.e. in L427) in process_cat.F90 since it will start with cold start. Note: the tile can not be in tropics!! Important: remember to restore the original process_cat.F90. clm_driver.F90 in clm4/ccsm4_0.models/lnd/clm/src/main: L290: #if (!defined CNDV) abortutils.F90: strip out everything and put a stop statement. Get rid of the c preprocessor Comment out the two use in L39-40 After L55: comment out the calls and add 'stop'in L63. abortutils.F90 should be added to the make file. ========== 20150821: 1. downloaded the CLM pftdata: land01:/terra/fzeng/clm> svn co --username guestuser --password friendly https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata/lnd/clm2/pftdata The one used in LDASsa_m2-14 and current LDASsa_m3-15 is: https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata/lnd/clm2/pftdata/pft-physiology.c100226 The one below is likely used in CLM4.5 and we are going to use it: https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata/lnd/clm2/pftdata/pft-physiology.c130503.nc Take a look at it: land01:/terra/fzeng/clm/pftdata> ncdump pft-physiology.c130503.nc 2. Compare the data in pft-physiology.c130503.nc with the data statement in CN_DriverMod.F90. ========== 20150824: 1. Continue to compare the data in pft-physiology.c130503.nc with the data statement in CN_DriverMod.F90. CLM4 CLM4.5 CN_DriverMOD.F90 pft-physiology.c130503.nc =========================================== z0mx: z0mr displax: displar c3psx: c3psn vcmx2x: ? mx: ? qe2x: ? slatox: slatop dsladlax: dsladlai leafcx: leafcn flnx: flnr fnitx: fnitr? woodx: woody lflitcx: lflitcn frootcx: frootcn livewdcx: livewdcn deadwdcx: deadwdcn dwoox: ? froot_leax: froot_leaf stem_leax: stem_leaf croot_stex: croot_stem flivewx: flivewd fcux: fcur lf_flax: lf_flab lf_fcex: lf_fcel lf_flix: lf_flig fr_flax: fr_flab fr_fcex: fr_fcel fr_flix: fr_flig leaf_lonx: leaf_long evergreex: evergreen resisx: ? stress_decix: stress_decid season_decix: season_decid xlx: xl rholx: rholvis rhosx: rhosvis taulx: taulvis tausx: tausvis Can't find vcmx2x, mx, qe2x, dwoox and resisx. Asked Greg. Greg said: "The first three would have been used by "stomata". I don't see them in "photosynthesis", so it appears they have been removed. "resist" is used in the fire modules, and I know it's been restructured, and I don;t see it used in CLM4.5. Not sure why "dwood" wouldn't be used... I see it is still used in CNVegStructUpdateMod.F90, so should be in the file." Still can't find dwood in pft-physiology.c130503.nc. dwood is initialized in the code (land01:/terra/fzeng/clm/cesm1_2_2/models/lnd/clm/src/clm4_5/main/pftvarcon.F90) instead of read in from some file. Don't know it's loaded to pftvarcon. It's also 2.5e5, same as CLM4. ========== 20150825: 1. Compare clmtype.F90 in land01:/terra/fzeng/clm/cesm1_2_2/models/lnd/clm/src/clm4_5/main and and CN_DriverMod.F90 in land01:~/clm4/point_driver_LDASsa_m3-15_2-CN to make sure the table in 20150824 is correct. 2. Copy the pft parameters from CN_DriverMod.F90 and pft-physiology.c130503.nc to an excel sheet (gs6101-fzengm1:/Volumes/G_DRIVE/03_Research_GMAO/CLM4to45/pftdata.xlsx), line up the data, then copy the data to Matlab to compare for noncrop (using diff=clm45-clm4) (gs6101-fzengm1:/Volumes/G_DRIVE/03_Research_GMAO/CLM4to45/pftdata.mat). Difference in noncrop: flnx and fnitx are different for almost all pft. For all pft, fnitx is 1 in CLM4.5 but <1 in CLM4. Broadleaf deciduous boreal shrub and C3 arctic grass are seasonal deciduous in CLM4.5 instead of stress deciduous in CLM4. This could be a problem for CN_restart. Can do a test run using CN_restart from p0005s_** (doing this in a separate directory so that I don't cross up with the code I am running). Run 1 cycle to see if it works. If it fails, it will fail at CNPhenologyMod.F90. The rest are the same. Crops in CLM4.5: ncorn (15) and ncornirrig (16) have the same parameter values, and these values only differ from those of ncrop (18) and ncrop2 (19) in our current model in flnx and fnitx. The parameter values of the other crop types in CLM4.5 differ from those of ncrop (18) and ncrop2 (19) in our current model in multiple parameters (slatox, flnx, fnitx, lflitcx, livewdcx, deadwdcx,etc.). So may just use the parameter values of ncorn from CLM4.5 in the new code for ncrop and ncrop2 as first step. That is, use the parameter values of 0-15, and split 10 (nbrdlf_dcd_tmp_shrub), 13 (nc3_nonarctic_grass), 14 (nc4_grass) and 15 (ncorn) to two each. Copy the data statement from CN_DriverMod.F90 to CN_DriverMod_data in land01:~/clm4/cesm1_2_2-testing, delete the lines for vcmx2x, mx, qe2x and resisx, replace the values of flnx, fnitx, stress_decix and season_decix with those of CLM4.5. pftvarcon.F90: ncropmin = ncorn, see where it's used. Not sure if we can add a directive control so that the code using it doesn't compile. May need to strip out the code that uses it. Take a look at the tech note of CLM4.5 to see what the generic crops are. See link in notes.20150825. Try using a directive control: in CNPhenologyMod.F90 and other routines that use it (look for this). ###Can revert the names in CN_DriverMod.F90: e.g. z0mx back to z0mr. Copy updated point_driver_LDASsa_m3-15_2-CN from Greg's directory. Done on 20150826. ###We want to get rid of as much as we can in clmtype.F90. Anything that are in save type will be saved instead of removed when the routine exits. May be can get rid of most of the "type, public :: column_wstate_**", most landunit_pstate_type, Things related to hydrology can mostly go. Anything related to C and N nees to stay. For the part about methane, can put a directive to control it or strip it out. If I strip out anything in clmtype.F90, I also need to delete it from clmtypeInitMod.F90. Don't want to use directives in clmtype.F90. In the CN code, use directives to by pass generic crops. If I mess with clmtype.F90, use -o0 in GNUmakefile to compile fast. 3. Made a copy of LDASsa_m3-15_2-CN in /discover/nobackup/fzeng/tmp and name it LDASsa_m3-15_2-CN-testing. In CN_DriverMod.F90, changed data stress_decix/ 0., 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0/ data season_decix/ 0., 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0/ to data stress_decix/ 0., 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0/ data season_decix/ 0., 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0/ Compile and copy the executable LDASsa_mpi_73q_e0008s.x back to /discover/nobackup/fzeng/LDASsa_m3-15_2-CN/exec. Set up a run p0008s: Copied CN_restart, land restart, lenkf.j and lenkf_test.j from p0005s_45. Submit a debug job. ========== 20150826: 1. The p0008s debug job failed because the lenkf_test.j from p0005s_45 still points to Greg's forcing data and I didn't notice that. Changed Greg's user id to mine and deleted the symbolic links. Works. Submitted the full job. Will run one cycle. 2. Read the crop section in "CLM45_Tech_Note.pdf": ###point_driver_LDASsa_m3-15_2-CN/pftvarcon.F90: should these two lines below be kept or removed? integer, parameter :: nc3crop = 29 !value for generic crop (rf) integer, parameter :: nc3irrig = 30 !value for irrigated generic crop (ir) The pfts currently in our carbon model look like the same as 0 to 15 in pfts of CLM4.5: confirmed (see Greg's notes on 20150821) P359: "CLM4.0 included interactive irrigation only for the generic C3 crops, i.e. plant functional types (pfts) 15 (rainfed) and 16 (irrigated) in the CLM list of pfts and not for the additional crops of the interactive crop management model (CROP)." p360: "In simulations without irrigation, the rainfed and irrigated crops merge into just rainfed crops at run time." 3. Understand how Greg implemented subroutine photosynthesis: Take a look at the difference: (files are in land01:~/clm4/cesm1_2_2-testing) stomata.F90 vs. photosynthesis.F90 stomata_compute_rc.F90 vs. photosynthesis_compute_rc.F90 ###Questions: How do I know I need to add t10, lai, vcmaxcint, and tlai to the argument list in photosynthesis_compute_rc.F90? How do I know sla is no longer needed in the argument list in photosynthesis_compute_rc.F90? Compare stomata.F90 to stomata_compute_rc.F90 to see what need to be calculated in the latter but not in the former. To calculate these ones in photosynthesis, t10, lai, vcmaxcint, and tlai are needed?