How to Modify Codes include a new model

  • Slides: 4
Download presentation
How to Modify Codes: include a new model Summary Step 1: put new model

How to Modify Codes: include a new model Summary Step 1: put new model simulations in the directory $ILAMB_ROOT/MODELS/original; Step 2: check $ILAMB_ROOT/CODES/subroutines/read/get_model. ncl for how to convert the unit for the new model; Step 3: modify Control Parameter table: $ILAMB_ROOT/CODES/INPUT/ILAMB_PARA_SETUP. Note: Please use CMIP 5 naming system and data structure, otherwise you may also need to modify $ILAMB_ROOT/CODES/subroutines/read_model. ncl to tell the package how to get the new model data.

Step 1: put new model simulations in the directory $ILAMB_ROOT/MODELS/original Method Please use CMIP

Step 1: put new model simulations in the directory $ILAMB_ROOT/MODELS/original Method Please use CMIP 5 name system and data structure, otherwise you may also need to modify read codes to tell the package how to get the new model data. You may find the codes to input CMIP 5 simulations below: $ILAMB_ROOT/CODES/subroutines/read_model. ncl $ILAMB_ROOT/CODES/subroutines/read/get_model. ncl

Step 2: check the code get_model. ncl to convert the unit for the new

Step 2: check the code get_model. ncl to convert the unit for the new model $ILAMB_ROOT/CODES/subroutines/read/get_model. ncl ……. ; ++++ convert co 2's unit from mol/mol to ppm ++++ if (str_lower(Var. Name). eq. "co 2") then ts 1=ts 1*1. 0 e 6 end if ; ++++ convert et's unit from Kg/m 2/s to mm/day ++++ if (str_lower(Var. Name). eq. "et") then ts 1=ts 1*24*3600. 0 end if ; ++++ convert pr's unit from Kg/m 2/s to mm/day ++++ if (str_lower(Var. Name). eq. "pr") then ts 1=ts 1*24*3600. 0 end if …………. �� str_lower(Var. Name). eq. "albedo") if ( then ts 1=read_model_vars (Data. Dir. Mod, cmip. ID, model. ID, exp. ID, run. ID, "rsds") ts 2=read_model_vars (Data. Dir. Mod, cmip. ID, model. ID, exp. ID, run. ID, "rsus") ts 1=where(ts 1. eq. 0, -999, ts 1) ts 1=ts 2/ts 1 delete(ts 2) end if …………. Method Copy and paste the code for one variable, and make change to get right unit conversion. If some variables are derived from other variables, you need make a copy like this showed in the left.

Step 3. Change Control Parameter File to show up the new model

Step 3. Change Control Parameter File to show up the new model