==========
20190301:

1. Feb report. 

2. Plotted FZ vs 617 difference in daily mean of MERRA2 6-hourly climatology using ~/geos5/FORECASTS_BCSD/Fanwei/verify_output.m. Tried to understand the pattern in the SWdown difference.

Discussed with Eunjee.

==========
20190304:

1. The process extracting daily MERRA2 fields finished over the weekend. Copied the data to land01:/land/fzeng/merra2 for Randy. Randy will extract some fields for Howard Forest for Qingyuan.

2. Processed March GMAO forecast. 

3. Plotted the difference in MERRA2 6-hourly SWdown climatology between mine and Code 617's using ~/geos5/FORECASTS_BCSD/Fanwei/verify_output.

4. Read Kattge et al., 2009 to find ways to improve Catchment-CN4.5 GPP.

5. Asked Weiyuan for help figure out the problem in my compare_ts.py -- why do the land mask and the data not line up?

6. Took the FY2019 CYBERSECURITY AND SENSITIVE UNCLASSIFIED INFORMATION AWARENESS TRAINING COURSE on Satern.

==========
20190305:

1. Emailed Randy to let him know that the daily MERRA2 data is ready on Land01.

2. Continued and completed the FY2019 CYBERSECURITY AND SENSITIVE UNCLASSIFIED INFORMATION AWARENESS TRAINING COURSE on Satern.

3. Continued reading Kattge et al., 2009 to find ways to improve Catchment-CN4.5 GPP.

4. Weiyuan found a bug in my matlab script in the part that reads the binary files written by fortran. Fixed the bug in the matlab script and modified the python script accordingly. Now the land and the data line up perfectly in the python script, but the global GPP is ~3 PgC/yr higher in the python script. Investigation ongoing ...

==========
20190306:

1. Weiyuan found another bug in my python script. After fixing this bug, now the python output matches the matlab output! Great!

2. Read Bonan et al., 2012 carefully. They might have used the Vcmax25 values from Kattge et al., 2009 for the final GPP calculation without further down-regulation by nitrogen limitation. The evidence is paragraph [23], without the CLM4CN carbon-nitrogen biogeochemistry (see paragraph [21]) and the fnitr values are all 1 in CLM4.5. 

CN_DriverMod.F90:
  data    fnitx      /   0.,    1.,    1.,    1.,    1.,    1.,    1.,    1.,    1.,    1.,    1.,    1.,    1.,    1.,    1.,    1.,    1.,    1.,    1.,    1./ ! largely changed from CLM4!

Will discuss with Eunjee tomorrow.

==========
20190307:

1. Prepared meeting slides.

2. Met with Randy, Lesley and Eunjee.

3. Plotted the difference in the January mean of MERRA2 6-hourly climatology using ~/geos5/FORECASTS_BCSD/Fanwei/verify_output.m. As expected, the difference is very small.  

4. Worked on upgrading CLM4 to CLM4.5. See notes in /discover/nobackup/fzeng/clm4-to-clm4.5/notes/notes_daily_2019.

5. Met with Eunjee. Her understanding on the Bonan et al., 2012 paper is consistent with mine, i.e. fnitr = 1 in their simulations with the CN model OFF. Great!

5. Made GPP and NEE time series plots for the IDS meeting next week, using 

~/matlab/clm4-to-clm4.5/compare_GPP_site_FLUXNET2015.m

==========
20190308:

1. Continued making GPP and NEE time series plots for the IDS meeting next week, using 

~/matlab/clm4-to-clm4.5/compare_GPP_site_FLUXNET2015.m

2. Continued working on the slides for the Land Modeling meeting Tuesday next week.

==========
20190311:

1. Worked on the slides for the IDS meeting on Wednesday this week.

2. Showed Eunjee the slides for the Land Modeling meeting and the IDS meeting. Revised to include her suggestions. 

3. Emailed Randy the slides for the Land Modeling meeting to see if he has any comments and suggestions. 

==========
20190312:

1. Add the mean seasonal cycle plots to the slides for the IDS meeting as backup slides. 

2. Sent the slides to Lesley and Randy for comments and suggestions. Lesley asked if we can add GPP and NBP global and regional annual time series plots. 

For these plots, we have to use the results from a transient CO2 run. I used the half degree run with 390ppm CO2 earlier following what I did for my presentation for the LMWG-BGCWG meeting. However, using results from this run our GPP will be about 150 Pg C/yr which is too high. 

Talked to Eunjee. She will make the GPP and NBP global and regional annual time series plots, which she has made before, and I will re-make all the site-level comparison plots, both using the output of my e0004s_transient_05.

3. Re-made all the site-level comparison plots using the output of my e0004s_transient_05. 

==========
20190313:

1. Updated all the plots, and the experiment information, in the slides for the IDS meeting.

2. Read Bonan et al., 2011 to find out what change from CLM4 to CLM4.5 has the largest impact on GPP. 

3. IDS meeting.

4. Prepared for meeting with Randy on Friday. This includes 2 above. 

5. Worked on upgrading CLM4 to CLM4.5. See notes in /discover/nobackup/fzeng/clm4-to-clm4.5/notes/notes_daily_2019.   

==========
20190321:

1. Worked on upgrading CLM4 to CLM4.5. See notes in /discover/nobackup/fzeng/clm4-to-clm4.5/notes/notes_daily_2019. 

2. Read CLM4 and CLM4.5 Tech Notes to understand why Vcmax should vary with daylength while solar radiation has already included the information of the daylength. 

3. Read CLM4 and CLM4.5 Tech Notes to think about how to use the CLM4 Vcmax25 values in Catchment-CN4.5. 

4. Archived data and released some space from NOBACKUP.

> cd /discover/nobackup/fzeng/Catchment/M2n5P 
> rm -rf DE_02880x01440
> rm -rf GEOSldas_CF90_old GEOSldas_CF90_satcap_old
> rm -rf GEOSldas_CF90_tmp

> cd /discover/nobackup/fzeng/Catchment/SMAP_EASEv2_M09 
> rm -rf e0004s_trCO2_20181204 e0005s_trCO2_20181116
> rm -rf e0005s_trCO2_point/ e0005s_trCO2_point_India
> rm -rf e0004s  [obsolete, now use e0004s_trCO2]

> cd /discover/nobackup/fzeng/Catchment/SMAP_EASEv2_M09_old
> tarem e0004s
> tarem e0005s

> cd /discover/nobackup/fzeng/Catchment/SMAP_EASEv2_M09
> tarem e0004s_wet2
> tarem e0004s_wet2_rzmc

5. Wrote ~/python/compare_LDASsa_GEOSldas_forcing.py to compare the meteorology forcing used in my e0004s_transientCO2 run and my GEOSldas_CF90 run, both using the same met tag. 

==========
20190322:

1. Continued archiving data and releasing some space from NOBACKUP.

> cd /discover/nobackup/fzeng/Catchment/SMAP_EASEv2_M09_old
> tarem e0004s_rzmc
> rm mk_CatchCNRestarts.F90.old
> rm CN_restart.20150401_00z.e0004s [already archived]
> rm e0004s.catch_ldas_rst.20150401_0000z.bin [already archived]
> cp -p catchcn_internal_rst catchcn_internal_rst_asnowm mk_catchcn_bin2nc4.F90  mk_CatchCNRestarts.F90*  notes /archive/u/fzeng/Catchment/SMAP_EASEv2_M09_old/.
> cd /discover/nobackup/fzeng/Catchment 
> rm -rf SMAP_EASEv2_M09_old

> cd /discover/nobackup/fzeng/Catchment/SMAP_EASEv2_M09
> rm -rf e0004s_wet2 e0004s_wet2_rzmc

> cd /archive/u/fzeng/Catchment/SMAP_EASEv2_M09
> rm e0005s_trCO2_0.5D_dailyNmonthly_201808.tgz e0005s_trCO2_201808_0.5D_dailyNmonthly.tgz e0005s_trCO2_201810_0.5D_dailyNmonthly.tgz e0005s_trCO2_20181120_0.5D_dailyNmonthly.tgz
> rm -rf e0005s_trCO2_201810
> rm e0004s_rzmc.tgz [e0004s_wet2_rzmc.tgz is the same as e0004s_rzmc.tgz]

2. Finished working on ~/python/compare_LDASsa_GEOSldas_forcing.py and used it to plot the forcing difference between two simulations e0004s_transientCO2 and GEOSldas_CF90. 

==========
20190325:

1. Worked on upgrading CLM4 to CLM4.5. See notes in /discover/nobackup/fzeng/clm4-to-clm4.5/notes/notes_daily_2019. 

2. Worked on slides for meeting with Randy this week.

==========
20190326:

1. Worked on upgrading CLM4 to CLM4.5. See notes in /discover/nobackup/fzeng/clm4-to-clm4.5/notes/notes_daily_2019.

==========
20190327:

1. Worked on upgrading CLM4 to CLM4.5. See notes in /discover/nobackup/fzeng/clm4-to-clm4.5/notes/notes_daily_2019.

==========
20190328:

1. Worked on upgrading CLM4 to CLM4.5. See notes in /discover/nobackup/fzeng/clm4-to-clm4.5/notes/notes_daily_2019.

2. Met with Randy and Eunjee.

3. Tried to get O365 work on my laptop.

==========
20190329:

1. Continued working on trying to get O365 work on my laptop.

2. Informed Abhishek about the bug in /home/fzeng/matlab/SMAP/read_CatchCN_fields.m:

The block
 
   fortran_tag     = fread(fid,    2,             int_precision);
   tmp_data_real   = fread(fid,    [nlon,nlat],   float_precision);
 
should be replaced by this block below:
 
    fortran_tag     = fread(fid,    1,             int_precision);
    tmp_data_real   = fread(fid,    [nlon,nlat],   float_precision);
    fortran_tag     = fread(fid,    1,             int_precision); 

3. Checked the e0004s_transientCO2_05 GPP and NEE and they look good. 

4. Prepared for the SMAP M09 transient CO2 run (will be the same as e0004s_transientCO2_05) to write out 3-hourly output of some fields for Eunjee and Lesley.

> cd /discover/nobackup/fzeng/Catchment/SMAP_EASEv2_M09/e0004s_transientCO2_05/output/SMAP_EASEv2_M09_GLOBAL/rs/ens0000 
> ls Y2000/M01
e0004s_transientCO2.ens0000.catchcn_ldas_rst.20000101_0000z
> ls Y2001/M01
e0004s_transientCO2.ens0000.catchcn_ldas_rst.20010101_0000z 

5. Talked to Eunjee and Lesley. They need 3-hourly output for the following fields for 2000-2017:

NEE
GPP
NPP
Fire (closs)

I can write the output to Lesley's project disk.

6. Modified LDASsa code for the SMAP M09 transient CO2 run to write out 3-hourly output for Eunjee and Lesley.

> cd /discover/nobackup/fzeng/LDASsa_m3-16_0_p2_CatchCatchCN_for_MERRA3/src/Components/GEOSlana_GridComp 
> /bin/cp -pr e0004s_transientCO2 e0004s_transientCO2_3hrlyOUT

> cd /discover/nobackup/fzeng/LDASsa_m3-16_0_p2_CatchCatchCN_for_MERRA3/src/Components/GEOSlana_GridComp/e0004s_wet2
> cp -p clsm_ensdrv_glob_param.F90  clsm_ensdrv_init_routines.F90 ../e0004s_transientCO2_3hrlyOUT/.

Following clsm_ensdrv_out_routines.F90, clsm_ensdrv_glob_param.F90 and clsm_ensdrv_init_routines.F90 in /discover/nobackup/fzeng/LDASsa_m3-16_0_p2_CatchCatchCN_for_MERRA3/src/Components/GEOSlana_GridComp/e0004s_wet2 to modify these 3 files in /discover/nobackup/fzeng/LDASsa_m3-16_0_p2_CatchCatchCN_for_MERRA3/src/Components/GEOSlana_GridComp/e0004s_transientCO2_3hrlyOUT. 

> cd /discover/nobackup/fzeng/LDASsa_m3-16_0_p2_CatchCatchCN_for_MERRA3/src/Components/GEOSlana_GridComp/e0004s_transientCO2_3hrlyOUT
> cp compute_rc.F90 ../../GEOSsurface_GridComp/GEOSland_GridComp/GEOScatchCN_GridComp/.
> cp clsm_ensdrv_glob_param.F90  clsm_ensdrv_init_routines.F90  clsm_ensdrv_out_routines.F90 process_cn.F90 ../.

> cd /discover/nobackup/fzeng/LDASsa_m3-16_0_p2_CatchCatchCN_for_MERRA3/src/Components/GEOSsurface_GridComp/GEOSland_GridComp/GEOScatchCN_GridComp
> setenv ESMADIR /discover/nobackup/fzeng/LDASsa_m3-16_0_p2_CatchCatchCN_for_MERRA3
> source $ESMADIR/src/g5_modules 
> gmake install

> cd ../../../GEOSlana_GridComp/
> gmake install

> cd ../../Applications/LDAS_App/
> gmake install

> cd ../../..
> mkdir -p exec/e0004s_transientCO2_3hrlyOUT
> /bin/cp -pr Linux/ exec/e0004s_transientCO2_3hrlyOUT/.

7. Set up the e0004s_transientCO2_3hrlyOUT run.

(1) Prepare files and run directory for experiment setup: 

> cd /discover/nobackup/fzeng/Catchment/SMAP_EASEv2_M09/run
> xdiff  M09_CN_e0004s_transientCO2.exe ../e0004s_transientCO2_05/run/. & [Identical. Good!]
> xdiff M09_e0004s_transientCO2.bat ../e0004s_transientCO2_05/run/. & [Identical. Good!]
> cp M09_e0004s_transientCO2.bat M09_e0004s_transientCO2_3hrlyOUT.bat
> cp M09_CN_e0004s_transientCO2.exe M09_CN_e0004s_transientCO2_3hrlyOUT.exe
> nedit M09_CN_e0004s_transientCO2_3hrlyOUT.exe &
exp_id                  = e0004s_transientCO2_3hrlyOUT
start_time              = 2000-01-01-00-00-00
end_time                = 2018-01-01-00-00-00
restart_path            = /discover/nobackup/fzeng/Catchment/SMAP_EASEv2_M09/e0004s_transientCO2_05/output/
restart_id              = e0004s_transientCO2_3hrlyOUT

> cp ../e0004s_transientCO2_05/run/driver_inputs_M09_GLOBAL.nml driver_inputs_M09_GLOBAL.nml
> nedit driver_inputs_M09_GLOBAL.nml &
! integer time steps for output [seconds]
	  
out_dtstep%rstrt     = 0            ! use out_rstrt_dtstep=0 for *monthly* restart output
out_dtstep%xhourly   = 10800
out_dtstep%inst      = 10800

! ensemble average output choices

out_select_ensavg%tile%inst    = .false. 
out_select_ensavg%tile%xhourly = .true.
out_select_ensavg%tile%daily   = .false.
out_select_ensavg%tile%pentad  = .false.	
out_select_ensavg%tile%monthly = .false. 

> cd /discover/nobackup/projects/gmao/geos_carb/fzeng/
> mkdir -p Catchment/SMAP_EASEv2_M09

(2) Run ldsetup:

> cd /discover/nobackup/fzeng/LDASsa_m3-16_0_p2_CatchCatchCN_for_MERRA3/exec/e0004s_transientCO2_3hrlyOUT/Linux/bin
> ./ldsetup setup /discover/nobackup/projects/gmao/geos_carb/fzeng/Catchment/SMAP_EASEv2_M09 /discover/nobackup/fzeng/Catchment/SMAP_EASEv2_M09/run/M09_CN_e0004s_transientCO2_3hrlyOUT.exe /discover/nobackup/fzeng/Catchment/SMAP_EASEv2_M09/run/M09_e0004s_transientCO2_3hrlyOUT.bat --runmodel --monthsperjob 10 --landmodel catchCN

(3) Check the executable, restart file and create year_co2.txt:

> cd /discover/nobackup/projects/gmao/geos_carb/fzeng/Catchment/SMAP_EASEv2_M09/e0004s_transientCO2_3hrlyOUT
> ls -l build/Linux/bin/LDASsaCN_mpi.x (to make sure the executable is the right one)
-rwxr-xr-x 1 fzeng g0620 69467340 2019-03-29 14:20 build/Linux/bin/LDASsaCN_mpi.x*
> ls -l input/restart/ (to make sure the restart file is the right one)
lrwxrwxrwx 1 fzeng g0620 80 2019-03-29 14:40 output -> /discover/nobackup/fzeng/Catchment/SMAP_EASEv2_M09/e0004s_transientCO2_05/output/

(4) Create year_co2.txt:

> cd run
> echo 2000 > year_co2.txt
> cat year_co2.txt (to make sure the year of CO2 is correct)
    2000 [Correct!]

(5) Modify the restart_id in the first job script:

> nedit lenkf.0.j &
 -restart_path ../input/restart/output \
 -restart_domain SMAP_EASEv2_M09_GLOBAL \
 -restart_id e0004s_transientCO2 \
 
(6) Create the ldas_batchrun.j file:

> cp /discover/nobackup/fzeng/clm4-to-clm4.5/LDAS/tests/clm4.5/clm4.5_DE720/run/ldas_batchrun.j .
> nedit ldas_batchrun.j &

(7) Did an interactive run to make sure it works:

> interactive.py -A sp3 -n 140 -a g0620 -X --debug
> cd /discover/nobackup/projects/gmao/geos_carb/fzeng/Catchment/SMAP_EASEv2_M09/e0004s_transientCO2_3hrlyOUT/run
> ./lenkf.0.j

It's running and writing out 3-hourly output. Stopped it at date_time_new 20000102_012230z.

(8) Submit all the jobs:

> ./ldas_batchrun.j
 
8. Created ~/Catchment/SMAP_M09/verify_e0004s_transientCO2_3hrlyOUT.gs and used it to check the 3-hourly output from the interactive run.

9. Restored the 5 files modified for e0004s_transientCO2_3hrlyOUT.

