diff --git a/common_ocean_post.txt b/common_ocean_post.txt index cf9ce8640464026fa9de6494b82507bc1cbe0e31..255274b992a819a002800be4a3c840f0a5ad17aa 100644 --- a/common_ocean_post.txt +++ b/common_ocean_post.txt @@ -71,6 +71,9 @@ fi if [ -e ${CON_FILES}/mask.regions.3d.${NEMOVERSION}.nc ] ; then cp ${CON_FILES}/mask.regions.3d.${NEMOVERSION}.nc mask_regions.3d.nc fi +if [ -e ${CON_FILES}/mask.regions.${NEMOVERSION}.nc ] ; then +cp ${CON_FILES}/mask.regions.${NEMOVERSION}.nc mask_regions.nc +fi if [[ ! -f mask.nc ]] ; then echo "No configuration files for cdftools" @@ -182,7 +185,7 @@ function concat_startdate { cdo_version=`cdo -V &> ff ; grep Climate ff | cut -d \ -f 5` rm ff #test on cdo version: if >1.5.6, remove valid_min/max attributes to avoid values out of that range to be replaced by NaN - if [[ "$cdo_version" = "`echo -e "$cdo_version\n1.5.6" | sort -V | head -n1`" ]] ; then + if [[ "$cdo_version" = "`echo -e "$cdo_version\n1.5.6" | sort -V | head -n1`" ]] || [[ "$cdo_version" = "`echo -e "$cdo_version\n1.6.3" | sort -V | head -n1`" ]] ; then if [[ $root == 'grid_T' || $root == 't3d' ]] ; then for file in $lstfiles ; do ncatted -O -a valid_max,votemper,d,, $file $file @@ -940,7 +943,7 @@ cp ${CON_FILES}/depth.${NEMOVERSION}.txt depth.txt case $3 in '') typeset var basin="Glob" ;; 'NAtl' | 'NPac' | 'TAtl' | 'TPac' | 'TInd' | 'Anta' | 'Arct' | 'Glob') typeset var basin=$3 ;; -*) mv mask.nc mask_tmp.nc ; mv mask_regions.3d.nc mask.nc ; typeset var lstvars=`cdo showvar mask.nc` ; if [[ ${lstvars/$3} != ${lstvars} ]] ; then ncrename -h -v $3,tmask mask.nc ; else echo 'This region does not exist, please choose another region' ; exit; fi ;; +*) mv mask.nc mask_tmp.nc ; mv mask_regions.3d.nc mask.nc ; typeset var lstvars=`cdo showvar mask.nc | sed -e "s/nav_lon//g" | sed -e "s/nav_lat//g"` ; if [[ ${lstvars/$3} != ${lstvars} ]] ; then ncrename -h -v $3,tmask mask.nc ; else echo 'This region does not exist, please choose another region' ; exit; fi ;; esac if [ -z "$4" ] ; then typeset var mxl=0 diff --git a/ocean_pp.bash b/ocean_pp.bash index edefc6819fbd4160e796db28d45a1628e5b1d029..bb7d840eda7148be1461e99322469002b385a380 100755 --- a/ocean_pp.bash +++ b/ocean_pp.bash @@ -409,10 +409,10 @@ for ((yeari=$syeari;yeari<=$syearf;yeari=$(($yeari+intsdate)))) ; do esac if [[ $raw_regions_ice == '' ]] ; then - lstseas=$( cdo showvar mask_regions.nc ) + lstseas=$( cdo showvar mask_regions.nc | sed -e "s/nav_lon//g" | sed -e "s/nav_lat//g" ) else if [[ $raw_regions_ice == 'default' ]] ; then - lstseas="Baffin_Bay Baltic_Sea Barents_Sea Beaufort_Sea Bering CanArch Chukchi_Sea CntArctic CntArcticRing1 CntArcticRing2 CntArcticRing3 CntArcticRing4 CntArcticRing5 CntArcticRing6 CntArcticRing7_Lincoln_Sea CntArcticRing8 CntArcticPrf1 CntArcticPrf2r CntArcticPrf3 CntArcticPrf4 East_Siberian_Sea1 Greenland_Sea Hudson Icelandic_Sea Irminger Japan1 Kara_Sea Laptev_Sea Labrador_Sea1 Norwegian_Sea Okhotsk StLawr" + lstseas="Baffin_Bay Baltic_Sea Barents_Sea Beaufort_Sea Bering CanArch Chukchi_Sea CntArctic CntArcticRing1 CntArcticRing2 CntArcticRing3 CntArcticRing4 CntArcticRing5 CntArcticRing6 CntArcticRing7_Lincoln_Sea CntArcticRing8 CntArcticPrf1 CntArcticPrf2r CntArcticPrf3 CntArcticPrf4 East_Siberian_Sea1 Greenland_Sea Hudson Icelandic_Sea Irminger_Sea Japan1 Kara_Sea Laptev_Sea Labrador_Sea1 Norwegian_Sea Okhotsk StLawr" else lstseas=$( echo ${raw_regions_ice[@]} ) fi @@ -457,10 +457,10 @@ for ((yeari=$syeari;yeari<=$syearf;yeari=$(($yeari+intsdate)))) ; do esac if [[ $raw_regions_ice == '' ]] ; then - lstseas=$( cdo showvar mask_regions.nc ) + lstseas=$( cdo showvar mask_regions.nc | sed -e "s/nav_lon//g" | sed -e "s/nav_lat//g" ) else if [[ $raw_regions_ice == 'default' ]] ; then - lstseas="Baffin_Bay Barents_Sea Beaufort_Sea Bering CanArch Chukchi_Sea East_Siberian_Sea Greenland_Sea Hudson Icelandic_Sea Kara_Sea Laptev_Sea Labrador_Sea Norwegian_Sea Okhotsk Central_Arctic" + lstseas="Baffin_Bay Barents_Sea Beaufort_Sea Bering CanArch Chukchi_Sea East_Siberian_Sea Greenland_Sea Hudson Icelandic_Sea Irminger_Sea Kara_Sea Laptev_Sea Labrador_Sea Norwegian_Sea Okhotsk Central_Arctic" else lstseas=$( echo ${raw_regions_ice[@]} ) fi diff --git a/setup_development.bash b/setup_development.bash index 9591a894ed1b6aed6278021684a07ed2bc4fcfac..8cac31b323703422f39473f3cd7fdc22e461df04 100755 --- a/setup_development.bash +++ b/setup_development.bash @@ -8,7 +8,8 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ set -evx # This does not need to be changed : -CON_FILES='/esnas/autosubmit/con_files' +CON_FILES='/esnas/scratch/ruben/CON_FILES' +#CON_FILES='/esnas/autosubmit/con_files' # This option is compatible with the testing on i00k but if you want to test # your developments on another experiment you would need to change this : NEMOVERSION=Ec2.3_O1L42 @@ -36,4 +37,4 @@ rm -f *grid* *icemod* # This is the final testing line. You need to replace that line by the function # you want to test (here it is ohc) followed by all its arguments (here we have # only the input file tmp.nc and the output file tmpout.nc) -ohc tmp.nc tmppout.nc 'Glob' +ohc tmp.nc tmppout.nc Baffin_Bay