Changeset 6366 for TOOLS/CPLRESTART/CreateRestartAtm4Oasis.bash
- Timestamp:
- 04/07/23 15:40:03 (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/CPLRESTART/CreateRestartAtm4Oasis.bash
r6327 r6366 27 27 28 28 # Usage exemples : 29 # CreateRestartAtm4Oasis.bash --oce ORCA2.3 /ccc/store/cont003/dsm/p25sepul/IGCM_OUT/IPSLCM5A2/PROD/piControl/CM5A2.1.pi.00/ATM/Output/MO/CM5A2.1.pi.00_40100101_40191231_1M_histmth.nc 30 # CreateRestartAtm4Oasis.bash --oce eORCA1.2 /ccc/store/cont003/gencmip6/p86maf/IGCM_OUT/IPSLCM6/PROD/piControl/CM61-LR-pi-03/ATM/Output/MO/CM61-LR-pi-03_23400101_23491231_1M_histmth.nc 31 # CreateRestartAtm4Oasis.bash --oce ORCA2.3 /ccc/work/cont003/gencmip6/bedidil/SAVE8_ORCA2/STORE1/dynamico_grid.nc 32 # CreateRestartAtm4Oasis.bash --oce ORCA2.3 /ccc/work/cont003/gencmip6/bedidil/SAVE9_ORCA2_DYN30_1MO/STORE1/histmth.nc 29 # CreateRestartAtm4Oasis.bash --oce ORCA2.3 /ccc/store/cont003/dsm/p25sepul/IGCM_OUT/IPSLCM5A2/PROD/piControl/CM5A2.1.pi.00/ATM/Output/MO/CM5A2.1.pi.00_40100101_40191231_1M_histmth.nc 30 # CreateRestartAtm4Oasis.bash --oce eORCA1.2 /ccc/store/cont003/gencmip6/p86maf/IGCM_OUT/IPSLCM6/PROD/piControl/CM61-LR-pi-03/ATM/Output/MO/CM61-LR-pi-03_23400101_23491231_1M_histmth.nc 31 # CreateRestartAtm4Oasis.bash --oce ORCA2.3 /ccc/work/cont003/gencmip6/bedidil/SAVE8_ORCA2/STORE1/dynamico_grid.nc 32 # CreateRestartAtm4Oasis.bash --oce ORCA2.3 /ccc/work/cont003/gencmip6/bedidil/SAVE9_ORCA2_DYN30_1MO/STORE1/histmth.nc 33 # CreateRestartAtm4Oasis.bash --oce eORCA1.4.2 /ccc/scratch/cont003/gencmip6/p86caub/RUN_DIR/9114048_89294/ICOLOR-SROUT.11.NBP80.HISTMTH.89294/histday.nc 33 34 34 35 ## =========================================================================== … … 56 57 set +e 57 58 R_IN=$(ccc_home -u igcmg --cccwork)/IGCM 58 TMPDIR=${CCC WORKDIR}/TMP59 SUBMIT_DIR=${BRIDGE_MSUB_PWD:-${SUBMIT_DIR }}59 TMPDIR=${CCCSCRATCHDIR}/TMP/CPLRESTART 60 SUBMIT_DIR=${BRIDGE_MSUB_PWD:-${SUBMIT_DIR:-$(pwd)}} 60 61 MpiRun="time ccc_mprun" 61 62 PyRun="time ccc_mprun -n 1" # Needed to force python to run on one process only … … 63 64 module load hdf5 64 65 module load netcdf-c 65 module load nco /4.9.166 module load cdo /1.9.567 module load python3 /3.7.266 module load nco # /4.9.1 67 module load cdo # /1.9.5 68 module load python3 # /3.7.2 68 69 module load datadir/igcmg 69 70 module list … … 84 85 set -o xtrace 85 86 set -e 87 88 mkdir -p ${TMPDIR} 89 90 cd ${TMPDIR} 86 91 87 92 while [[ ${1} = -* ]] ; do … … 108 113 #AtmFile=${1:-/ccc/store/cont003/dsm/p25sepul/IGCM_OUT/IPSLCM5A2/PROD/piControl/CM5A2.1.pi.00/ATM/Output/MO/CM5A2.1.pi.00_40100101_40191231_1M_histmth.nc} 109 114 #AtmFile=${1:-/ccc/work/cont003/gencmip6/bedidil/SAVE8_ORCA2/STORE1/dynamico_grid.nc} 110 AtmFile=${1:-/ccc/ work/cont003/gencmip6/bedidil/SAVE9_ORCA2_DYN30_1MO/STORE1/histmth.nc}115 AtmFile=${1:-/ccc/scratch/cont003/gencmip6/p86caub/RUN_DIR/9114048_89294/ICOLOR-SROUT.11.NBP80.HISTMTH.89294/histday.nc} 111 116 112 117 # … … 115 120 FL_FMT=64bit 116 121 117 ##118 ## Extract variables119 ## ===========================================================================120 ncks --overwrite --fl_fmt=${FL_FMT} --history --dimension time_counter,0,0 --variable lon,lat,sols,soll,fract_oce,fract_sic,precip,snow,evap_sic,evap_oce,wind10m,taux_oce,tauy_oce,taux_sic,tauy_sic ${AtmFile} flxat_fields.nc121 ncwa --overwrite --fl_fmt=${FL_FMT} --history --average time_counter flxat_fields.nc flxat_fields_notime.nc # remove time dimension122 ncatted --history --attribute history,global,d,c,"" flxat_fields_notime.nc # cleaning of history attributes123 122 124 ## 125 ## Determines if the file is unstructured (Dynamico) or lon/lat (LMDZ) 126 ## Set atmosphere name 127 ## =========================================================================== 128 Count=$(ncdump -h flxat_fields_notime.nc | grep nvertex | wc -l) 123 Count=$(ncdump -h ${AtmFile} | grep nvertex | wc -l) 129 124 if [[ ${Count} -gt 0 ]] ; then 130 IsUnstructured= yes131 dim_cell=$(ncdump -h flxat_fields_notime.nc|& grep "cell *=" | awk '{print $3}' ) # Get nominal DYNAMICO resolution (nbp parameter)125 IsUnstructured=True 126 dim_cell=$(ncdump -h ${AtmFile} |& grep "cell *=" | awk '{print $3}' ) # Get nominal DYNAMICO resolution (nbp parameter) 132 127 ico_nbp=$( echo "sqrt(($dim_cell-2)/10)" | bc -l | sed 's/\..*//' ) 133 128 ATM=ICO${ico_nbp} 134 ncrename --history --dimension cell,y flxat_fields_notime.nc 135 cat <<EOF > add_dim.nco 136 defdim("x",1) ; 137 lon [y,x] = lon ; 138 lat [y,x] = lat ; 139 sols [y,x] = sols ; 140 soll [y,x] = soll ; 141 fract_oce[y,x] = fract_oce ; 142 fract_sic[y,x] = fract_sic ; 143 precip [y,x] = precip ; 144 snow [y,x] = snow ; 145 evap_sic [y,x] = evap_sic ; 146 evap_oce [y,x] = evap_oce ; 147 wind10m [y,x] = wind10m ; 148 taux_oce [y,x] = taux_oce ; 149 tauy_oce [y,x] = tauy_oce ; 150 taux_sic [y,x] = taux_sic ; 151 tauy_sic [y,x] = tauy_sic ; 152 EOF 153 ncap2 --history --overwrite --fl_fmt=${FL_FMT} --script-file add_dim.nco flxat_fields_notime.nc tmp_flxat_fields_notime.nc 154 mv tmp_flxat_fields_notime.nc flxat_fields_notime.nc 129 155 130 else 156 131 # lat/lon 157 IsUnstructured=no 158 dim_lat=$(ncdump -h flxat_fields_notime.nc | grep "lat *=" | awk '{print $3}' ) 159 dim_lon=$(ncdump -h flxat_fields_notime.nc | grep "lon *=" | awk '{print $3}' ) 160 ncrename --history --dimension lon,x flxat_fields_notime.nc 161 ncrename --history --dimension lat,y flxat_fields_notime.nc 162 cat <<EOF > add_dim.nco 163 lon[y,x] = lon ; 164 lat[y,x] = lat ; 165 EOF 166 ncap2 --history --overwrite --fl_fmt=${FL_FMT} --script-file add_dim.nco flxat_fields_notime.nc tmp_flxat_fields_notime.nc 167 mv tmp_flxat_fields_notime.nc flxat_fields_notime.nc 132 IsUnstructured=False 133 dim_lat=$(ncdump -h ${AtmFile} | grep "lat *=" | awk '{print $3}' ) 134 dim_lon=$(ncdump -h ${AtmFile} | grep "lon *=" | awk '{print $3}' ) 135 #ncrename --history --dimension lon,x flxat_fields_notime.nc 136 #ncrename --history --dimension lat,y flxat_fields_notime.nc 168 137 (( dim_lat = dim_lat - 1 )) 169 138 ATM=LMD${dim_lon}${dim_lat} 170 139 (( n_lat = dim_lat - 1 )) 171 172 173 140 fi 174 141 175 142 echo "Version atmosphere : " ${ATM} 176 177 143 178 144 ## … … 180 146 ## =========================================================================== 181 147 182 python3 create_flxat.py --IsUnstructured=${IsUnstructured} --input flxat_fields_notime.nc --output tmp_flxat.nc148 python3 ${SUBMIT_DIR}/create_flxat.py --IsUnstructured=${IsUnstructured} --input ${AtmFile} --output flxat.nc 183 149 184 #this is not needed anymore since bounds are included in flxat.py if they exist 185 #[[ ${IsUnstructured} = yes ]] && ncks --fl_fmt=${FL_FMT} --history --append --variable bounds_lon,bounds_lat tmp_flxat.nc 186 ncks --fl_fmt=${FL_FMT} --append --history --variable COTAUXXU,COTAUYYU,COTAUZZU,COTAUXXV,COTAUYYV,COTAUZZV,COTOTRAI,COTOTSNO,COTOTEVA,COICEVAP,COQSRMIX,COQNSMIX,COSHFICE,CONSFICE,CODFLXDT,COCALVIN,COLIQRUN,COWINDSP,COTAUMOD tmp_flxat.nc flxat.nc 150 #ncks --fl_fmt=${FL_FMT} --append --history --variable COTAUXXU,COTAUYYU,COTAUZZU,COTAUXXV,COTAUYYV,COTAUZZV,COTOTRAI,COTOTSNO,COTOTEVA,COICEVAP,COQSRMIX,COQNSMIX,COSHFICE,CONSFICE,CODFLXDT,COCALVIN,COLIQRUN,COWINDSP,COTAUMOD tmp_flxat.nc flxat.nc 187 151 188 152 ## … … 191 155 192 156 UUID=$(uuid) 193 NCO="$(ncks --version |& tail -1 |sed 's/ncks //')"157 NCO="$(ncks --version |& tail -1 | sed 's/ncks //')" 194 158 ncatted --history \ 195 159 --attribute nco_openmp_thread_number,global,d,, \ 196 --attribute source,global,o,c,"IPSL Earth system model" \197 --attribute group,global,o,c,"ICMC IPSL Climate Modelling Center" \198 --attribute Institution,global,o,c,"IPSL https://www.ipsl.fr" \199 --attribute Model,global,o,c,"${ATM} http://lmdz.lmd.jussieu.fr" \200 --attribute Ocean,global,o,c,"${OCE} https://www.nemo-ocean.eu" \201 160 --attribute production,global,o,c,"$(finger ${LOGNAME} | head -1 | awk '{print $4, $5}')" \ 202 --attribute originalFiles,global,o,c,"${AtmFile}" \ 203 --attribute directory,global,o,c,"$(pwd)" \ 204 --attribute description,global,o,c,"Fields needed by OASIS-MCT" \ 205 --attribute timeStamp,global,o,c,"$(date)" \ 206 --attribute Program,global,o,c,"Generated by ${0}" \ 161 --attribute Program,global,o,c,"Generated by ${0}" \ 162 --attribute originalFiles,global,o,c,"${AtmFile}" \ 207 163 --attribute uuid,global,o,c,"${UUID}" \ 208 --attribute HOSTNAME,global,o,c,"$(hostname)" \209 --attribute LOGNAME,global,o,c,"$(whoami)" \210 164 --attribute NCO,global,o,c,"NCO netCDF Operator ${NCO} http://nco.sourceforge.net" \ 211 --attribute OS,global,o,c,"$(uname -o)" \212 --attribute release,global,o,c,"$(uname -r)" \213 --attribute hardware,global,o,c,"$(uname -i)" \214 --attribute directory,global,o,c,"$(pwd)" \215 165 --attribute Comment,global,o,c,"${Comment}" \ 216 --attribute Comment,global,o,c,"Preliminary attempt - Do not trust !" \217 --attribute SVN_Author,global,o,c,"$Author$" \218 --attribute SVN_Date,global,o,c,"$Date$" \219 --attribute SVN_Revision,global,o,c,"$Revision$" \220 --attribute SVN_Id,global,o,c,"$Id$" \221 166 flxat.nc 222 223 167 224 168 ## … … 229 173 ncks --history --variable COCALVIN flxat_${ATM}_maskFrom_${OCE}.nc icshf_${ATM}_maskFrom_${OCE}.nc 230 174 231 ##232 ## Cleaning233 ## ===========================================================================234 rm -f flxat_fields.nc flxat_fields_notime.nc tmp_flxat.nc235 236 175 ## =========================================================================== 237 176 ##
Note: See TracChangeset
for help on using the changeset viewer.