ShijingLiang

View the Project on GitHub

Notifications

The information above can be found in [FAQ: Data ocean slab mode (DOCN-SOM) Page 4 DiscussCESM Forums (ucar.edu)](https://bb.cgd.ucar.edu/cesm/threads/faq-data-ocean-slab-mode-docn-som.2017/page-4)

Prepare data

[tutorial4_4.png]

File format

I first interpolated satellite-observed data to CESM2 output resolution with python. It is important to keep the file formatted and add the attributes for each variable.

time (cftime.DatetimeNoleap)

date (int YYYYMMDD) For Feburary, date should be 19800215 Other months, date is 19800115

datesec (int 43200 or 0)

Fill values on land using ncl

The SST and SIC are interpolated over land. It is necssaey for the model to have values over land otherwise, it will crash but the values over land don’t impact the simulation. Because I am not familiar with ncl, you could also format your output data here. The data must be formatted before starting the bcgen tool.

You may create the ncl file by typing the following statements:

filename = “/mnt/e/CESM-SST/sstice_obs.nc”
out_file = “/mnt/e/CESM-SST/sstice_obs_fillnan.nc”
fin = addfile(filename,”r”)
SST = fin->SST
SEAICE = fin->SEAICE

poisson_grid_fill(SST, True, 1, 500, 0.01, 0.6, 0)
poisson_grid_fill(SEAICE, True, 1, 500, 0.01, 0.6, 0)

fout = addfile(out_file,”c”)
fout->SST = (/SST/)
fout->SEAICE = (/SEAICE/)
fout->ICEFRAC = (/SEAICE/100./)

Use bcgen tool to do the “diddling” approach

  1. Open and read README!!! Read README at /work/ese-liangll/CESM2.1.3/my_cesm_sandbox/components/cam/tools/icesst/
  2. Check environment settings You will need to check Fortran compiler in your .bashrc, by typing

    [ese-liangll@login02 ~]$ vi ~/.bashrc
    export F90=ifort

  3. Go to bcgen tool directory
    \[ese-liangll@login02 ~]$ cd /work/ese-liangll/CESM2.1.3/my_cesm_sandbox/components/cam/tools/icesst/bcgen/  
    \[ese-liangll@login02 bcgen]$ vi Makefile
    

Set LIB_NETCDF and INC_NETCDF path
[tutorial4_1.png]

Set other flags
Here I simply set FC=ifort
[tutorial4_2.png]

  1. After modifying the Makefile, compile the bcgen tool

    [ese-liangll@login02 bcgen]$ make

If you are lucky and make it successfully, you may notice there is a “*.o” file for each “*.f90” file Most importantly, you obtain the “bcgen” excutable file
[tutorial4_3.png]

  1. Revise the namelist
    \[ese-liangll@login02 bcgen]$ vi namelist
    

    &cntlvars mon1 = 1
    iyr1 = 1980
    monn = 12
    iyrn = 2024
    mon1rd = 12
    iyr1rd = 1980
    monnrd = 2
    iyrnrd = 2024
    mon1clm = 1
    iyr1clm = 1982
    monnclm = 12
    iyrnclm = 2001
    mon1out = 1
    iyr1out = 2014
    monnout = 12
    iyrnout = 2023
    /

  2. Run the bcgen tool
    \[ese-liangll@login02 bcgen]$./bcgen -i sstice.nc -c sstice_clim.nc -t sstice_ts.nc < namelist