From 48f3d0d4796dd4a491c76c2011cb3ea893584630 Mon Sep 17 00:00:00 2001 From: ezhilsabareesh8 Date: Thu, 5 Dec 2024 14:32:08 +1100 Subject: [PATCH 01/14] Remove submodule initial_conditions_WOA --- .gitmodules | 3 --- initial_conditions_WOA | 1 - 2 files changed, 4 deletions(-) delete mode 160000 initial_conditions_WOA diff --git a/.gitmodules b/.gitmodules index 4f2b66d..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "initial_conditions_WOA"] - path = initial_conditions_WOA - url = https://github.com/COSIMA/initial_conditions_WOA.git diff --git a/initial_conditions_WOA b/initial_conditions_WOA deleted file mode 160000 index 1693e4e..0000000 --- a/initial_conditions_WOA +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1693e4e68b950072527c2629f3e8d1f35e81d7f6 From ad4c3ecf8cd683c7e4c2fb9bb7edfdfcfa6febe8 Mon Sep 17 00:00:00 2001 From: ezhilsabareesh8 Date: Fri, 6 Dec 2024 15:28:08 +1100 Subject: [PATCH 02/14] Remove initial_condition_WOA submodule --- .gitmodules | 3 +++ initial_conditions_WOA23/ocean-ic | 1 + 2 files changed, 4 insertions(+) create mode 160000 initial_conditions_WOA23/ocean-ic diff --git a/.gitmodules b/.gitmodules index e69de29..5739cd3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "initial_conditions_WOA23/ocean-ic"] + path = initial_conditions_WOA23/ocean-ic + url = git@github.com:COSIMA/ocean-ic.git diff --git a/initial_conditions_WOA23/ocean-ic b/initial_conditions_WOA23/ocean-ic new file mode 160000 index 0000000..dedabdb --- /dev/null +++ b/initial_conditions_WOA23/ocean-ic @@ -0,0 +1 @@ +Subproject commit dedabdbd191c42c46008b3c1548c444740907fe8 From 847e95b9120976de29f4b7e2f3b4b00bbed864da Mon Sep 17 00:00:00 2001 From: ezhilsabareesh8 Date: Fri, 6 Dec 2024 15:40:44 +1100 Subject: [PATCH 03/14] Change WOA13 to WOA23 --- README | 65 +---------- copy_to_input_rc.sh | 10 +- finalise.sh | 10 +- initial_conditions_WOA23/01/make_ic | 30 ++++++ initial_conditions_WOA23/01/md5sum.txt | 3 + initial_conditions_WOA23/025/make_ic | 31 ++++++ initial_conditions_WOA23/025/md5sum.txt | 3 + initial_conditions_WOA23/10/make_ic | 30 ++++++ initial_conditions_WOA23/10/md5sum.txt | 3 + initial_conditions_WOA23/README | 9 ++ .../make_inital_conditions.sh | 22 ++++ inte.csh | 102 +++++++----------- setup_WOA_initial_conditions.py | 39 +++---- 13 files changed, 200 insertions(+), 157 deletions(-) create mode 100755 initial_conditions_WOA23/01/make_ic create mode 100644 initial_conditions_WOA23/01/md5sum.txt create mode 100755 initial_conditions_WOA23/025/make_ic create mode 100644 initial_conditions_WOA23/025/md5sum.txt create mode 100755 initial_conditions_WOA23/10/make_ic create mode 100644 initial_conditions_WOA23/10/md5sum.txt create mode 100644 initial_conditions_WOA23/README create mode 100755 initial_conditions_WOA23/make_inital_conditions.sh diff --git a/README b/README index 7add41a..5d046b9 100644 --- a/README +++ b/README @@ -1,70 +1,15 @@ -Tools to produce conservative temperature and salinity from World Ocean Atlas data, and regrid them to the ACCESS-OM2 model grids. +Tools to produce conservative temperature and salinity from World Ocean Atlas 2023 data, and regrid them to the ACCESS-OM3 model grids. 1. Run inte.csh to create temperature and salinity files, using monthly data instead of - seasonal dta in the upper 1500m. Results are put in /g/data/ik11/inputs/access-om2/woa13/monthly + seasonal dta in the upper 1500m. Results are put in /g/data/ik11/inputs/access-om3/woa23/monthly 2. Run make_inital_conditions.sh in the directory initial_conditions_WOA/ for regridding. - Results are put in /g/data/ik11/inputs/access-om2/woa13/[01]* + Results are put in /g/data/ik11/inputs/access-om3/woa23/[01]* 3. If you're happy with the results, run finalise.sh to git commit and add commit info to the .nc metadata - 4. If you have permissions you can run copy_to_input_rc.sh to copy January initial conditions to /g/data/ik11/inputs/access-om2/input_rc + 4. If you have permissions you can run copy_to_input_rc.sh to copy January initial conditions to /g/data/ik11/inputs/access-om3/input_rc This repository contains submodules, so clone it with -git clone --recursive https://github.com/COSIMA/initial_conditions_access-om2.git - --------------- - -2017-11-14 Fanghua Wu - -====================================================================================== -Summary about processing the 12-month data for different degree versions: -====================================================================================== - -01 version -====================================================================================== - Resource Usage on 2017-10-09 21:43:12: - Job Id: 9558755.r-man2 - Project: x77 - Exit Status: 0 - Service Units: 131.75 - NCPUs Requested: 8 NCPUs Used: 8 - CPU Time Used: 07:10:09 - Memory Requested: 64.0GB Memory Used: 18.22GB - Walltime requested: 12:00:00 Walltime Used: 05:29:23 - JobFS requested: 400.0GB JobFS used: 3.3GB -====================================================================================== - -025 version -====================================================================================== - Resource Usage on 2017-10-01 12:02:43: - Job Id: 9277169.r-man2 - Project: x77 - Exit Status: 0 - Service Units: 17.33 - NCPUs Requested: 8 NCPUs Used: 8 - CPU Time Used: 01:14:23 - Memory Requested: 64.0GB Memory Used: 4.62GB - Walltime requested: 01:00:00 Walltime Used: 00:43:20 - JobFS requested: 400.0GB JobFS used: 757.63MB -====================================================================================== - -10 version -====================================================================================== - Resource Usage on 2017-10-01 11:14:44: - Job Id: 9277004.r-man2 - Project: x77 - Exit Status: 0 - Service Units: 5.48 - NCPUs Requested: 8 NCPUs Used: 8 - CPU Time Used: 00:19:43 - Memory Requested: 64.0GB Memory Used: 3.18GB - Walltime requested: 01:00:00 Walltime Used: 00:13:42 - JobFS requested: 400.0GB JobFS used: 299.24MB -====================================================================================== - - -2020-06-24: Andrew Kiss - - copied from /g/data/hh5/tmp/cosima/observations/postprocessing/woa13/tools/ - - set up git repo +git clone --recursive https://github.com/ACCESS-NRI/initial_conditions_access-om3.git \ No newline at end of file diff --git a/copy_to_input_rc.sh b/copy_to_input_rc.sh index 792f47b..cff977c 100755 --- a/copy_to_input_rc.sh +++ b/copy_to_input_rc.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh -srcpath=/g/data/ik11/inputs/access-om2/woa13 -dstpath=/g/data/ik11/inputs/access-om2/input_rc +srcpath=/g/data/ik11/inputs/access-om3/woa23 +dstpath=/g/data/ik11/inputs/access-om3/input_rc echo "WARNING: About to copy initial conditions from ${srcpath} to ${dstpath}" read -p "Proceed? (y/n) " yesno @@ -13,8 +13,8 @@ esac set -e set -x -cp --preserve --remove-destination ${srcpath}/10/woa13_ts_01_mom10.nc ${dstpath}/mom_1deg/ocean_temp_salt.res.nc -cp --preserve --remove-destination ${srcpath}/025/woa13_ts_01_mom025.nc ${dstpath}/mom_025deg/ocean_temp_salt.res.nc -cp --preserve --remove-destination ${srcpath}/01/woa13_ts_01_mom01.nc ${dstpath}/mom_01deg/ocean_temp_salt.res.nc +cp --preserve --remove-destination ${srcpath}/10/woa23_ts_01_mom10.nc ${dstpath}/mom_1deg/ocean_temp_salt.res.nc +cp --preserve --remove-destination ${srcpath}/025/woa23_ts_01_mom025.nc ${dstpath}/mom_025deg/ocean_temp_salt.res.nc +cp --preserve --remove-destination ${srcpath}/01/woa23_ts_01_mom01.nc ${dstpath}/mom_01deg/ocean_temp_salt.res.nc echo "done" diff --git a/finalise.sh b/finalise.sh index 64543c1..3707c57 100755 --- a/finalise.sh +++ b/finalise.sh @@ -17,17 +17,17 @@ set -e git commit -am "update" || true git push || true -outpath=/g/data/ik11/inputs/access-om2/woa13 +outpath=/g/data/ik11/inputs/access-om3/woa23 dirs=("10" "025" "01") for d in ${dirs[@]}; do - for f in ${outpath}/${d}/woa13_ts_??_mom${d}.nc; do - ncatted -O -h -a history,global,a,c," | Created on $(date) using https://github.com/COSIMA/initial_conditions_access-om2/tree/$(git rev-parse --short HEAD)" $f + for f in ${outpath}/${d}/woa23_ts_??_mom${d}.nc; do + ncatted -O -h -a history,global,a,c," | Created on $(date) using https://github.com/ACCESS-NRI/initial_conditions_access-om3.git/tree/$(git rev-parse --short HEAD)" $f done done -for f in ${outpath}/monthly/woa13_*.nc; do - ncatted -O -h -a history,global,a,c," | Created on $(date) using https://github.com/COSIMA/initial_conditions_access-om2/tree/$(git rev-parse --short HEAD)" $f +for f in ${outpath}/monthly/woa23_*.nc; do + ncatted -O -h -a history,global,a,c," | Created on $(date) using https://github.com/ACCESS-NRI/initial_conditions_access-om3.git/tree/$(git rev-parse --short HEAD)" $f done set +e diff --git a/initial_conditions_WOA23/01/make_ic b/initial_conditions_WOA23/01/make_ic new file mode 100755 index 0000000..4deede7 --- /dev/null +++ b/initial_conditions_WOA23/01/make_ic @@ -0,0 +1,30 @@ +#!/bin/bash +#PBS -P x77 +#PBS -q normal +#PBS -l mem=64Gb +#PBS -l walltime=10:00:00 +#PBS -l jobfs=400GB +#PBS -l ncpus=8 +#PBS -l wd +#PBS -lstorage=gdata/hh5+gdata/ik11 + +module purge +module use /g/data/hh5/public/modules +module load conda/analysis3 +module load esmf + +GRIDDIR='/g/data/ik11/inputs/access-om3/0.x.0/1deg/mom' +ln -sf $GRIDDIR/ocean_hgrid.nc ocean_hgrid.nc +ln -sf $GRIDDIR/ocean_vgrid.nc ocean_vgrid.nc + +PATH=../ocean-ic/:$PATH + +for((i=1; i<=12; i++)) +do +printf -v mon "%02d" "${i}" +echo /g/data/ik11/inputs/access-om3/woa23/monthly/woa23_decav_ts_"${mon}"_04v2.nc +ln -sf /g/data/ik11/inputs/access-om3/woa23/monthly/woa23_decav_ts_"${mon}"_04v2.nc input.nc + +mkdir -p /g/data/ik11/inputs/access-om3/woa23/01 +makeic.py --use_mpi WOA input.nc input.nc input.nc input.nc MOM ocean_hgrid.nc ocean_vgrid.nc /g/data/ik11/inputs/access-om3/woa23/01/woa23_ts_"${mon}"_mom01.nc +done diff --git a/initial_conditions_WOA23/01/md5sum.txt b/initial_conditions_WOA23/01/md5sum.txt new file mode 100644 index 0000000..4cd4055 --- /dev/null +++ b/initial_conditions_WOA23/01/md5sum.txt @@ -0,0 +1,3 @@ +ecc3cc5d9c1345a0a118b82239205a2d input.nc +806e858470aa65592d88d3374a312b72 ocean_hgrid.nc +3c5934ca1bd87414f26a9e7a7eb85d7b ocean_vgrid.nc diff --git a/initial_conditions_WOA23/025/make_ic b/initial_conditions_WOA23/025/make_ic new file mode 100755 index 0000000..348b19b --- /dev/null +++ b/initial_conditions_WOA23/025/make_ic @@ -0,0 +1,31 @@ +#!/bin/bash +#PBS -P tm70 +#PBS -q normal +#PBS -l mem=64Gb +#PBS -l walltime=1:00:00 +#PBS -l jobfs=400GB +#PBS -l ncpus=8 +#PBS -l wd +#PBS -l storage=gdata/hh5+gdata/ik11 + +module purge +module use /g/data/hh5/public/modules +module load conda/analysis3 +module load esmf + +GRIDDIR='/g/data/ik11/inputs/access-om3/0.x.0/025deg/mom' +ln -sf $GRIDDIR/ocean_hgrid.nc ocean_hgrid.nc +ln -sf $GRIDDIR/ocean_vgrid.nc ocean_vgrid.nc + +PATH=../ocean-ic/:$PATH +echo $PATH + +for((i=1; i<=12; i++)) +do +printf -v mon "%02d" "${i}" +echo /g/data/ik11/inputs/access-om3/woa23/monthly/woa23_decav_ts_"${mon}"_04.nc +ln -sf /g/data/ik11/inputs/access-om3/woa23/monthly/woa23_decav_ts_"${mon}"_04.nc input.nc + +mkdir -p /g/data/ik11/inputs/access-om3/woa23/025 +makeic.py --use_mpi WOA input.nc input.nc input.nc input.nc MOM ocean_hgrid.nc ocean_vgrid.nc /g/data/ik11/inputs/access-om3/woa23/025/woa23_ts_"${mon}"_mom025.nc +done diff --git a/initial_conditions_WOA23/025/md5sum.txt b/initial_conditions_WOA23/025/md5sum.txt new file mode 100644 index 0000000..53ae8ad --- /dev/null +++ b/initial_conditions_WOA23/025/md5sum.txt @@ -0,0 +1,3 @@ +ecc3cc5d9c1345a0a118b82239205a2d input.nc +f6771f4915e3db11331712e9e9058b7c ocean_hgrid.nc +3eebb7bf7bb317749c9d4d0c1ca6a59c ocean_vgrid.nc diff --git a/initial_conditions_WOA23/10/make_ic b/initial_conditions_WOA23/10/make_ic new file mode 100755 index 0000000..9b0ff88 --- /dev/null +++ b/initial_conditions_WOA23/10/make_ic @@ -0,0 +1,30 @@ +#!/bin/bash +#PBS -P x77 +#PBS -q normal +#PBS -l mem=64Gb +#PBS -l walltime=2:00:00 +#PBS -l jobfs=400GB +#PBS -l ncpus=8 +#PBS -l wd +#PBS -lstorage=gdata/hh5+gdata/ik11 + +module purge +module use /g/data/hh5/public/modules +module load conda/analysis3 +module load esmf + +GRIDDIR='/g/data/ik11/inputs/access-om3/0.x.0/10deg/mom' +ln -sf $GRIDDIR/ocean_hgrid.nc ocean_hgrid.nc +ln -sf $GRIDDIR/ocean_vgrid.nc ocean_vgrid.nc + +PATH=../ocean-ic/:$PATH + +for((i=1; i<=12; i++)) +do +printf -v mon "%02d" "${i}" +echo /g/data/ik11/inputs/access-om3/woa23/monthly/woa23_decav_ts_"${mon}"_04v2.nc +ln -sf /g/data/ik11/inputs/access-om3/woa23/monthly/woa23_decav_ts_"${mon}"_04v2.nc input.nc + +mkdir -p /g/data/ik11/inputs/access-om3/woa23/10 +makeic.py --use_mpi WOA input.nc input.nc input.nc input.nc MOM ocean_hgrid.nc ocean_vgrid.nc /g/data/ik11/inputs/access-om3/woa23/10/woa23_ts_"${mon}"_mom10.nc +done diff --git a/initial_conditions_WOA23/10/md5sum.txt b/initial_conditions_WOA23/10/md5sum.txt new file mode 100644 index 0000000..a029c99 --- /dev/null +++ b/initial_conditions_WOA23/10/md5sum.txt @@ -0,0 +1,3 @@ +ecc3cc5d9c1345a0a118b82239205a2d input.nc +08c7b38d058580de272dadd3a5d349b7 ocean_hgrid.nc +ff1af784e6efe2a3cc3f6b219c49c929 ocean_vgrid.nc diff --git a/initial_conditions_WOA23/README b/initial_conditions_WOA23/README new file mode 100644 index 0000000..4ab38f1 --- /dev/null +++ b/initial_conditions_WOA23/README @@ -0,0 +1,9 @@ +# Initial Condition Files for MOM Ocean Grids Using World Ocean Atlas 2023 (WOA23) + +This repository contains the tools and scripts to generate initial condition files for 3 MOM ocean grids from World Ocean Atlas 2023 (WOA23) data. The repository leverages Nic Hannah's `ocean-ic` code for interpolating the salt and temperature fields onto the 3D MOM ocean grids. + +# Generate Initial Conditions + +To generate initial condition files for a specific MOM ocean grid, execute the following script with the grid resolution as a command-line argument: + +./make_initial_conditions.sh diff --git a/initial_conditions_WOA23/make_inital_conditions.sh b/initial_conditions_WOA23/make_inital_conditions.sh new file mode 100755 index 0000000..9c0fc8b --- /dev/null +++ b/initial_conditions_WOA23/make_inital_conditions.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Check if a resolution is provided as a command-line argument +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + echo "Valid resolutions: 01, 025, 10" + exit 1 +fi + +# Assign the provided resolution to a variable +RESOLUTION="$1" + +# Validate the resolution +if [[ "$RESOLUTION" != "01" && "$RESOLUTION" != "025" && "$RESOLUTION" != "10" ]]; then + echo "Invalid resolution: $RESOLUTION" + echo "Valid resolutions are: 01, 025, 10" + exit 1 +fi + +# Execute make_initial_conditions.sh with the specified resolution + +cd $RESOLUTION && qsub make_ic diff --git a/inte.csh b/inte.csh index 31235d2..35b0e1b 100755 --- a/inte.csh +++ b/inte.csh @@ -1,71 +1,51 @@ #!/bin/csh -f -# -#================================================================== -# The meaning of woa13 data name: woa13_decav_sXX_04v2.nc -# XX: 00 means annual mean, the whole depth -# 01-12 means monthly mean, only upper 1500m -# 13-16 means seasonal mean, 13 for Winter, 14 for Spring, -# 15 for Summer, 16 for Autumn. -# 13-16 with the whole depth -# -# reproduce the monthly data based on seasonal data, then using -# the monthly mean data instead of data on the upper 1500m ocean. -# -# This script is doing: -# 1. extract the variable salinity 's_an' from seaonsal data -# to each month. -# 2. using 'ncks --mk_rec time' to add unlimited attribute of time. -# 3. rename salinity name from 's_an' to 'practical_salinity' -# 4. using 'setup_WOA_initial_conditions.py' to processing the -# conservative temperature. -#================================================================== -# module use /g/data/hh5/public/modules module load conda/analysis3 module load nco -set src_dir = /g/data/ik11/inputs/WOA13v2/averaged_decades -set dst_dir = /g/data/ik11/inputs/access-om2/woa13/monthly +set src_dir = /g/data/ik11/inputs/WOA23 +set dst_dir = /g/data/ik11/inputs/access-om3/woa23/monthly + mkdir -p $dst_dir echo 'extract salinity' -ncks -v s_an $src_dir/woa13_decav_s13_04v2.nc $dst_dir/woa13_decav_ts_01_04v2.nc -ncks --mk_rec time $dst_dir/woa13_decav_ts_01_04v2.nc -o $dst_dir/test.nc -mv $dst_dir/test.nc $dst_dir/woa13_decav_ts_01_04v2.nc -ncks -v s_an $src_dir/woa13_decav_s13_04v2.nc $dst_dir/woa13_decav_ts_02_04v2.nc -ncks --mk_rec time $dst_dir/woa13_decav_ts_02_04v2.nc -o $dst_dir/test.nc -mv $dst_dir/test.nc $dst_dir/woa13_decav_ts_02_04v2.nc -ncks -v s_an $src_dir/woa13_decav_s13_04v2.nc $dst_dir/woa13_decav_ts_03_04v2.nc -ncks --mk_rec time $dst_dir/woa13_decav_ts_03_04v2.nc -o $dst_dir/test.nc -mv $dst_dir/test.nc $dst_dir/woa13_decav_ts_03_04v2.nc -ncks -v s_an $src_dir/woa13_decav_s14_04v2.nc $dst_dir/woa13_decav_ts_04_04v2.nc -ncks --mk_rec time $dst_dir/woa13_decav_ts_04_04v2.nc -o $dst_dir/test.nc -mv $dst_dir/test.nc $dst_dir/woa13_decav_ts_04_04v2.nc -ncks -v s_an $src_dir/woa13_decav_s14_04v2.nc $dst_dir/woa13_decav_ts_05_04v2.nc -ncks --mk_rec time $dst_dir/woa13_decav_ts_05_04v2.nc -o $dst_dir/test.nc -mv $dst_dir/test.nc $dst_dir/woa13_decav_ts_05_04v2.nc -ncks -v s_an $src_dir/woa13_decav_s14_04v2.nc $dst_dir/woa13_decav_ts_06_04v2.nc -ncks --mk_rec time $dst_dir/woa13_decav_ts_06_04v2.nc -o $dst_dir/test.nc -mv $dst_dir/test.nc $dst_dir/woa13_decav_ts_06_04v2.nc -ncks -v s_an $src_dir/woa13_decav_s15_04v2.nc $dst_dir/woa13_decav_ts_07_04v2.nc -ncks --mk_rec time $dst_dir/woa13_decav_ts_07_04v2.nc -o $dst_dir/test.nc -mv $dst_dir/test.nc $dst_dir/woa13_decav_ts_07_04v2.nc -ncks -v s_an $src_dir/woa13_decav_s15_04v2.nc $dst_dir/woa13_decav_ts_08_04v2.nc -ncks --mk_rec time $dst_dir/woa13_decav_ts_08_04v2.nc -o $dst_dir/test.nc -mv $dst_dir/test.nc $dst_dir/woa13_decav_ts_08_04v2.nc -ncks -v s_an $src_dir/woa13_decav_s15_04v2.nc $dst_dir/woa13_decav_ts_09_04v2.nc -ncks --mk_rec time $dst_dir/woa13_decav_ts_09_04v2.nc -o $dst_dir/test.nc -mv $dst_dir/test.nc $dst_dir/woa13_decav_ts_09_04v2.nc -ncks -v s_an $src_dir/woa13_decav_s16_04v2.nc $dst_dir/woa13_decav_ts_10_04v2.nc -ncks --mk_rec time $dst_dir/woa13_decav_ts_10_04v2.nc -o $dst_dir/test.nc -mv $dst_dir/test.nc $dst_dir/woa13_decav_ts_10_04v2.nc -ncks -v s_an $src_dir/woa13_decav_s16_04v2.nc $dst_dir/woa13_decav_ts_11_04v2.nc -ncks --mk_rec time $dst_dir/woa13_decav_ts_11_04v2.nc -o $dst_dir/test.nc -mv $dst_dir/test.nc $dst_dir/woa13_decav_ts_11_04v2.nc -ncks -v s_an $src_dir/woa13_decav_s16_04v2.nc $dst_dir/woa13_decav_ts_12_04v2.nc -ncks --mk_rec time $dst_dir/woa13_decav_ts_12_04v2.nc -o $dst_dir/test.nc -mv $dst_dir/test.nc $dst_dir/woa13_decav_ts_12_04v2.nc +ncks -v s_an $src_dir/woa23_decav_s13_04.nc $dst_dir/woa23_decav_ts_01_04.nc +ncks --mk_rec time $dst_dir/woa23_decav_ts_01_04.nc -o $dst_dir/test.nc +mv $dst_dir/test.nc $dst_dir/woa23_decav_ts_01_04.nc +ncks -v s_an $src_dir/woa23_decav_s13_04.nc $dst_dir/woa23_decav_ts_02_04.nc +ncks --mk_rec time $dst_dir/woa23_decav_ts_02_04.nc -o $dst_dir/test.nc +mv $dst_dir/test.nc $dst_dir/woa23_decav_ts_02_04.nc +ncks -v s_an $src_dir/woa23_decav_s13_04.nc $dst_dir/woa23_decav_ts_03_04.nc +ncks --mk_rec time $dst_dir/woa23_decav_ts_03_04.nc -o $dst_dir/test.nc +mv $dst_dir/test.nc $dst_dir/woa23_decav_ts_03_04.nc +ncks -v s_an $src_dir/woa23_decav_s14_04.nc $dst_dir/woa23_decav_ts_04_04.nc +ncks --mk_rec time $dst_dir/woa23_decav_ts_04_04.nc -o $dst_dir/test.nc +mv $dst_dir/test.nc $dst_dir/woa23_decav_ts_04_04.nc +ncks -v s_an $src_dir/woa23_decav_s14_04.nc $dst_dir/woa23_decav_ts_05_04.nc +ncks --mk_rec time $dst_dir/woa23_decav_ts_05_04.nc -o $dst_dir/test.nc +mv $dst_dir/test.nc $dst_dir/woa23_decav_ts_05_04.nc +ncks -v s_an $src_dir/woa23_decav_s14_04.nc $dst_dir/woa23_decav_ts_06_04.nc +ncks --mk_rec time $dst_dir/woa23_decav_ts_06_04.nc -o $dst_dir/test.nc +mv $dst_dir/test.nc $dst_dir/woa23_decav_ts_06_04.nc +ncks -v s_an $src_dir/woa23_decav_s15_04.nc $dst_dir/woa23_decav_ts_07_04.nc +ncks --mk_rec time $dst_dir/woa23_decav_ts_07_04.nc -o $dst_dir/test.nc +mv $dst_dir/test.nc $dst_dir/woa23_decav_ts_07_04.nc +ncks -v s_an $src_dir/woa23_decav_s15_04.nc $dst_dir/woa23_decav_ts_08_04.nc +ncks --mk_rec time $dst_dir/woa23_decav_ts_08_04.nc -o $dst_dir/test.nc +mv $dst_dir/test.nc $dst_dir/woa23_decav_ts_08_04.nc +ncks -v s_an $src_dir/woa23_decav_s15_04.nc $dst_dir/woa23_decav_ts_09_04.nc +ncks --mk_rec time $dst_dir/woa23_decav_ts_09_04.nc -o $dst_dir/test.nc +mv $dst_dir/test.nc $dst_dir/woa23_decav_ts_09_04.nc +ncks -v s_an $src_dir/woa23_decav_s16_04.nc $dst_dir/woa23_decav_ts_10_04.nc +ncks --mk_rec time $dst_dir/woa23_decav_ts_10_04.nc -o $dst_dir/test.nc +mv $dst_dir/test.nc $dst_dir/woa23_decav_ts_10_04.nc +ncks -v s_an $src_dir/woa23_decav_s16_04.nc $dst_dir/woa23_decav_ts_11_04.nc +ncks --mk_rec time $dst_dir/woa23_decav_ts_11_04.nc -o $dst_dir/test.nc +mv $dst_dir/test.nc $dst_dir/woa23_decav_ts_11_04.nc +ncks -v s_an $src_dir/woa23_decav_s16_04.nc $dst_dir/woa23_decav_ts_12_04.nc +ncks --mk_rec time $dst_dir/woa23_decav_ts_12_04.nc -o $dst_dir/test.nc +mv $dst_dir/test.nc $dst_dir/woa23_decav_ts_12_04.nc echo 'rename salinity to practical_salinity' @ mons = 1 @@ -73,10 +53,10 @@ echo 'rename salinity to practical_salinity' @ imon = {$mons} while ( $imon <= $mone ) echo "month = " {$imon} -ncrename -v s_an,practical_salinity $dst_dir/woa13_decav_ts_`printf "%02d" {$imon}`_04v2.nc +ncrename -v s_an,practical_salinity $dst_dir/woa23_decav_ts_`printf "%02d" {$imon}`_04.nc @ imon ++ end echo 'processing conservative temperature' -time python3 setup_WOA_initial_conditions.py +time python3 setup_WOA_initial_conditions.py $src_dir/ $dst_dir/ diff --git a/setup_WOA_initial_conditions.py b/setup_WOA_initial_conditions.py index 73058e2..bc0e6d8 100644 --- a/setup_WOA_initial_conditions.py +++ b/setup_WOA_initial_conditions.py @@ -13,48 +13,44 @@ import netCDF4 as nc import matplotlib.pyplot as plt -# paths -src_data_dir = '/g/data/ik11/inputs/WOA13v2/averaged_decades/' -# output paths -dst_data_dir = '/g/data/ik11/inputs/access-om2/woa13/monthly/' +# Usage: +# python setup_WOA_initial_conditions.py +# Example: +# python setup_WOA_initial_conditions.py /path/to/source/dir /path/to/destination/dir -print('Importing WOA13 raw data') +src_data_dir = sys.argv[1] # Source directory for WOA23 data, raw data stored in "/g/data/ik11/inputs/WOA23" +dst_data_dir = sys.argv[2] # Destination directory to save output files + +print('Importing WOA23 raw data') mon = ['01','02','03','04','05','06','07','08','09','10','11','12'] deepmon = ['13','13','13','14','14','14','15','15','15','16','16','16'] i = 0 for mm in range(0,len(mon)): i = i+1 # get upper ocean temp data: - woa_file = src_data_dir+'woa13_decav_t'+mon[mm]+'_04v2.nc' + woa_file = src_data_dir+'woa23_decav_t'+mon[mm]+'_04.nc' print(woa_file) ncFile = nc.Dataset(woa_file) lat = ncFile.variables['lat'][...] - #lat_bnds = ncFile.variables['lat_bnds'][...] - #lon_bnds = ncFile.variables['lon_bnds'][...] - #depth_upper_bnds = ncFile.variables['depth_bnds'][...] depth_upper = ncFile.variables['depth'][...] lon = ncFile.variables['lon'][...] t_in_situ_upper = ncFile.variables['t_an'][0,...] - #time = ncFile.variables['time'][...] # get upper ocean salinity data: - #woa_file = data_dir+'woa13_decav_s01_04v2.nc' - woa_file = src_data_dir+'woa13_decav_s'+mon[mm]+'_04v2.nc' + woa_file = src_data_dir+'woa23_decav_s'+mon[mm]+'_04.nc' print(woa_file) ncFile = nc.Dataset(woa_file) s_practical_upper = ncFile.variables['s_an'][0,...] # get lower ocean temp data: - #woa_file = data_dir+'woa13_decav_t13_04v2.nc' - woa_file = src_data_dir+'woa13_decav_t'+deepmon[mm]+'_04v2.nc' + woa_file = src_data_dir+'woa23_decav_t'+deepmon[mm]+'_04.nc' print(woa_file) ncFile = nc.Dataset(woa_file) depth_lower = ncFile.variables['depth'][...] t_in_situ_lower = ncFile.variables['t_an'][0,...] # get lower ocean salinity data: - #woa_file = data_dir+'woa13_decav_s13_04v2.nc' - woa_file = src_data_dir+'woa13_decav_s'+deepmon[mm]+'_04v2.nc' + woa_file = src_data_dir+'woa23_decav_s'+deepmon[mm]+'_04.nc' print(woa_file) ncFile = nc.Dataset(woa_file) s_practical_lower = ncFile.variables['s_an'][0,...] @@ -93,8 +89,7 @@ t_conservative = gsw.CT_from_t(s_absolute,t_in_situ,pressure_tile) # save to netcdf - #save_file = data_dir + 'woa13_decav_ts_jan_04v2.nc' - save_file = dst_data_dir + 'woa13_decav_ts_'+mon[mm]+'_04v2.nc' + save_file = dst_data_dir + 'woa23_decav_ts_'+mon[mm]+'_04.nc' print(save_file) ncFile = nc.Dataset(save_file,'r+') @@ -112,13 +107,5 @@ ' analysed mean fields for sea_water_temperature' t_var[0,:] = t_conservative -#s_var = ncFile.createVariable('practical_salinity', 'f4', ('time','depth','lat','lon'),fill_value=9.96921e+36) -#s_var.units = '1' -#s_var.grid_mapping = "crs" -#s_var.long_name = 'Objectively analyzed mean fields for sea_water_salinity at standard depth levels.' -#s_var.missing_value = 9.96921e+36 -#s_practical[np.where(np.isnan(s_practical)==True)] = 9.96921e+36 -#s_var[0,:] = s_practical - ncFile.close() From a160b95923ffb822f1a062bf23638a9a08f1b4f5 Mon Sep 17 00:00:00 2001 From: ezhilsabareesh8 <108497463+ezhilsabareesh8@users.noreply.github.com> Date: Mon, 16 Dec 2024 13:31:08 +1100 Subject: [PATCH 04/14] Remove project Co-authored-by: Anton Steketee <79179784+anton-seaice@users.noreply.github.com> --- initial_conditions_WOA23/01/make_ic | 1 - 1 file changed, 1 deletion(-) diff --git a/initial_conditions_WOA23/01/make_ic b/initial_conditions_WOA23/01/make_ic index 4deede7..7ac02af 100755 --- a/initial_conditions_WOA23/01/make_ic +++ b/initial_conditions_WOA23/01/make_ic @@ -1,5 +1,4 @@ #!/bin/bash -#PBS -P x77 #PBS -q normal #PBS -l mem=64Gb #PBS -l walltime=10:00:00 From 50727848f9db592558588b5b9647ee5187b517f4 Mon Sep 17 00:00:00 2001 From: ezhilsabareesh8 <108497463+ezhilsabareesh8@users.noreply.github.com> Date: Mon, 16 Dec 2024 13:31:22 +1100 Subject: [PATCH 05/14] Remove project Co-authored-by: Anton Steketee <79179784+anton-seaice@users.noreply.github.com> --- initial_conditions_WOA23/025/make_ic | 1 - 1 file changed, 1 deletion(-) diff --git a/initial_conditions_WOA23/025/make_ic b/initial_conditions_WOA23/025/make_ic index 348b19b..883d9d1 100755 --- a/initial_conditions_WOA23/025/make_ic +++ b/initial_conditions_WOA23/025/make_ic @@ -1,5 +1,4 @@ #!/bin/bash -#PBS -P tm70 #PBS -q normal #PBS -l mem=64Gb #PBS -l walltime=1:00:00 From a6c90e22e15e7fab268d2f2c7ef806bd68efea05 Mon Sep 17 00:00:00 2001 From: ezhilsabareesh8 <108497463+ezhilsabareesh8@users.noreply.github.com> Date: Mon, 16 Dec 2024 13:31:37 +1100 Subject: [PATCH 06/14] Remove project Co-authored-by: Anton Steketee <79179784+anton-seaice@users.noreply.github.com> --- initial_conditions_WOA23/10/make_ic | 1 - 1 file changed, 1 deletion(-) diff --git a/initial_conditions_WOA23/10/make_ic b/initial_conditions_WOA23/10/make_ic index 9b0ff88..c9133e9 100755 --- a/initial_conditions_WOA23/10/make_ic +++ b/initial_conditions_WOA23/10/make_ic @@ -1,5 +1,4 @@ #!/bin/bash -#PBS -P x77 #PBS -q normal #PBS -l mem=64Gb #PBS -l walltime=2:00:00 From 40f107919b9ae782b7c45fea37336f10a8738edd Mon Sep 17 00:00:00 2001 From: ezhilsabareesh8 <108497463+ezhilsabareesh8@users.noreply.github.com> Date: Mon, 16 Dec 2024 13:32:19 +1100 Subject: [PATCH 07/14] Remove matplotlib module Co-authored-by: Anton Steketee <79179784+anton-seaice@users.noreply.github.com> --- setup_WOA_initial_conditions.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup_WOA_initial_conditions.py b/setup_WOA_initial_conditions.py index bc0e6d8..5baf6d2 100644 --- a/setup_WOA_initial_conditions.py +++ b/setup_WOA_initial_conditions.py @@ -11,7 +11,6 @@ import os,sys import numpy as np import netCDF4 as nc -import matplotlib.pyplot as plt # Usage: # python setup_WOA_initial_conditions.py From 6d4b3f7e93acad8cf3ffbff1437c2dcefb7aafc6 Mon Sep 17 00:00:00 2001 From: ezhilsabareesh8 Date: Mon, 16 Dec 2024 16:02:38 +1100 Subject: [PATCH 08/14] remove directories of each resolution --- initial_conditions_WOA23/01/make_ic | 29 ------------------ initial_conditions_WOA23/01/md5sum.txt | 3 -- initial_conditions_WOA23/025/make_ic | 30 ------------------- initial_conditions_WOA23/025/md5sum.txt | 3 -- initial_conditions_WOA23/10/make_ic | 29 ------------------ initial_conditions_WOA23/10/md5sum.txt | 3 -- .../make_inital_conditions.sh | 22 -------------- 7 files changed, 119 deletions(-) delete mode 100755 initial_conditions_WOA23/01/make_ic delete mode 100644 initial_conditions_WOA23/01/md5sum.txt delete mode 100755 initial_conditions_WOA23/025/make_ic delete mode 100644 initial_conditions_WOA23/025/md5sum.txt delete mode 100755 initial_conditions_WOA23/10/make_ic delete mode 100644 initial_conditions_WOA23/10/md5sum.txt delete mode 100755 initial_conditions_WOA23/make_inital_conditions.sh diff --git a/initial_conditions_WOA23/01/make_ic b/initial_conditions_WOA23/01/make_ic deleted file mode 100755 index 7ac02af..0000000 --- a/initial_conditions_WOA23/01/make_ic +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -#PBS -q normal -#PBS -l mem=64Gb -#PBS -l walltime=10:00:00 -#PBS -l jobfs=400GB -#PBS -l ncpus=8 -#PBS -l wd -#PBS -lstorage=gdata/hh5+gdata/ik11 - -module purge -module use /g/data/hh5/public/modules -module load conda/analysis3 -module load esmf - -GRIDDIR='/g/data/ik11/inputs/access-om3/0.x.0/1deg/mom' -ln -sf $GRIDDIR/ocean_hgrid.nc ocean_hgrid.nc -ln -sf $GRIDDIR/ocean_vgrid.nc ocean_vgrid.nc - -PATH=../ocean-ic/:$PATH - -for((i=1; i<=12; i++)) -do -printf -v mon "%02d" "${i}" -echo /g/data/ik11/inputs/access-om3/woa23/monthly/woa23_decav_ts_"${mon}"_04v2.nc -ln -sf /g/data/ik11/inputs/access-om3/woa23/monthly/woa23_decav_ts_"${mon}"_04v2.nc input.nc - -mkdir -p /g/data/ik11/inputs/access-om3/woa23/01 -makeic.py --use_mpi WOA input.nc input.nc input.nc input.nc MOM ocean_hgrid.nc ocean_vgrid.nc /g/data/ik11/inputs/access-om3/woa23/01/woa23_ts_"${mon}"_mom01.nc -done diff --git a/initial_conditions_WOA23/01/md5sum.txt b/initial_conditions_WOA23/01/md5sum.txt deleted file mode 100644 index 4cd4055..0000000 --- a/initial_conditions_WOA23/01/md5sum.txt +++ /dev/null @@ -1,3 +0,0 @@ -ecc3cc5d9c1345a0a118b82239205a2d input.nc -806e858470aa65592d88d3374a312b72 ocean_hgrid.nc -3c5934ca1bd87414f26a9e7a7eb85d7b ocean_vgrid.nc diff --git a/initial_conditions_WOA23/025/make_ic b/initial_conditions_WOA23/025/make_ic deleted file mode 100755 index 883d9d1..0000000 --- a/initial_conditions_WOA23/025/make_ic +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -#PBS -q normal -#PBS -l mem=64Gb -#PBS -l walltime=1:00:00 -#PBS -l jobfs=400GB -#PBS -l ncpus=8 -#PBS -l wd -#PBS -l storage=gdata/hh5+gdata/ik11 - -module purge -module use /g/data/hh5/public/modules -module load conda/analysis3 -module load esmf - -GRIDDIR='/g/data/ik11/inputs/access-om3/0.x.0/025deg/mom' -ln -sf $GRIDDIR/ocean_hgrid.nc ocean_hgrid.nc -ln -sf $GRIDDIR/ocean_vgrid.nc ocean_vgrid.nc - -PATH=../ocean-ic/:$PATH -echo $PATH - -for((i=1; i<=12; i++)) -do -printf -v mon "%02d" "${i}" -echo /g/data/ik11/inputs/access-om3/woa23/monthly/woa23_decav_ts_"${mon}"_04.nc -ln -sf /g/data/ik11/inputs/access-om3/woa23/monthly/woa23_decav_ts_"${mon}"_04.nc input.nc - -mkdir -p /g/data/ik11/inputs/access-om3/woa23/025 -makeic.py --use_mpi WOA input.nc input.nc input.nc input.nc MOM ocean_hgrid.nc ocean_vgrid.nc /g/data/ik11/inputs/access-om3/woa23/025/woa23_ts_"${mon}"_mom025.nc -done diff --git a/initial_conditions_WOA23/025/md5sum.txt b/initial_conditions_WOA23/025/md5sum.txt deleted file mode 100644 index 53ae8ad..0000000 --- a/initial_conditions_WOA23/025/md5sum.txt +++ /dev/null @@ -1,3 +0,0 @@ -ecc3cc5d9c1345a0a118b82239205a2d input.nc -f6771f4915e3db11331712e9e9058b7c ocean_hgrid.nc -3eebb7bf7bb317749c9d4d0c1ca6a59c ocean_vgrid.nc diff --git a/initial_conditions_WOA23/10/make_ic b/initial_conditions_WOA23/10/make_ic deleted file mode 100755 index c9133e9..0000000 --- a/initial_conditions_WOA23/10/make_ic +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -#PBS -q normal -#PBS -l mem=64Gb -#PBS -l walltime=2:00:00 -#PBS -l jobfs=400GB -#PBS -l ncpus=8 -#PBS -l wd -#PBS -lstorage=gdata/hh5+gdata/ik11 - -module purge -module use /g/data/hh5/public/modules -module load conda/analysis3 -module load esmf - -GRIDDIR='/g/data/ik11/inputs/access-om3/0.x.0/10deg/mom' -ln -sf $GRIDDIR/ocean_hgrid.nc ocean_hgrid.nc -ln -sf $GRIDDIR/ocean_vgrid.nc ocean_vgrid.nc - -PATH=../ocean-ic/:$PATH - -for((i=1; i<=12; i++)) -do -printf -v mon "%02d" "${i}" -echo /g/data/ik11/inputs/access-om3/woa23/monthly/woa23_decav_ts_"${mon}"_04v2.nc -ln -sf /g/data/ik11/inputs/access-om3/woa23/monthly/woa23_decav_ts_"${mon}"_04v2.nc input.nc - -mkdir -p /g/data/ik11/inputs/access-om3/woa23/10 -makeic.py --use_mpi WOA input.nc input.nc input.nc input.nc MOM ocean_hgrid.nc ocean_vgrid.nc /g/data/ik11/inputs/access-om3/woa23/10/woa23_ts_"${mon}"_mom10.nc -done diff --git a/initial_conditions_WOA23/10/md5sum.txt b/initial_conditions_WOA23/10/md5sum.txt deleted file mode 100644 index a029c99..0000000 --- a/initial_conditions_WOA23/10/md5sum.txt +++ /dev/null @@ -1,3 +0,0 @@ -ecc3cc5d9c1345a0a118b82239205a2d input.nc -08c7b38d058580de272dadd3a5d349b7 ocean_hgrid.nc -ff1af784e6efe2a3cc3f6b219c49c929 ocean_vgrid.nc diff --git a/initial_conditions_WOA23/make_inital_conditions.sh b/initial_conditions_WOA23/make_inital_conditions.sh deleted file mode 100755 index 9c0fc8b..0000000 --- a/initial_conditions_WOA23/make_inital_conditions.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# Check if a resolution is provided as a command-line argument -if [ "$#" -ne 1 ]; then - echo "Usage: $0 " - echo "Valid resolutions: 01, 025, 10" - exit 1 -fi - -# Assign the provided resolution to a variable -RESOLUTION="$1" - -# Validate the resolution -if [[ "$RESOLUTION" != "01" && "$RESOLUTION" != "025" && "$RESOLUTION" != "10" ]]; then - echo "Invalid resolution: $RESOLUTION" - echo "Valid resolutions are: 01, 025, 10" - exit 1 -fi - -# Execute make_initial_conditions.sh with the specified resolution - -cd $RESOLUTION && qsub make_ic From 0b81d29bb455c2929da31a25755f3696729a5a48 Mon Sep 17 00:00:00 2001 From: ezhilsabareesh8 Date: Mon, 16 Dec 2024 16:04:02 +1100 Subject: [PATCH 09/14] configure make_ic --- initial_conditions_WOA23/make_ic | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 initial_conditions_WOA23/make_ic diff --git a/initial_conditions_WOA23/make_ic b/initial_conditions_WOA23/make_ic new file mode 100755 index 0000000..17526a4 --- /dev/null +++ b/initial_conditions_WOA23/make_ic @@ -0,0 +1,40 @@ +#!/bin/bash +#PBS -q normal +#PBS -l mem=64Gb +#PBS -l walltime=1:00:00 +#PBS -l jobfs=400GB +#PBS -l ncpus=8 +#PBS -l wd +#PBS -l storage=gdata/hh5+gdata/ik11 + +GRIDDIR=$GRIDDIR +INPUT_DIR=$INPUT_DIR +OUTPUT_DIR=$OUTPUT_DIR + +module purge +module use /g/data/hh5/public/modules +module load conda/analysis3 +module load esmf + +# Link grid files +ln -sf "${GRIDDIR}/ocean_hgrid.nc" ocean_hgrid.nc +ln -sf "${GRIDDIR}/ocean_vgrid.nc" ocean_vgrid.nc + +PATH=../ocean-ic/:$PATH +echo $PATH + +# Create output directory if it doesn't exist +mkdir -p "${OUTPUT_DIR}" + +# Process each month +for ((i=1; i<=12; i++)) +do + printf -v mon "%02d" "${i}" + INPUT_FILE="${INPUT_DIR}/woa23_decav_ts_${mon}_04.nc" + OUTPUT_FILE="${OUTPUT_DIR}/woa23_ts_${mon}_mom025.nc" + + echo "Processing: ${INPUT_FILE}" + ln -sf "${INPUT_FILE}" input.nc + + makeic.py --use_mpi WOA input.nc input.nc input.nc input.nc MOM ocean_hgrid.nc ocean_vgrid.nc "${OUTPUT_FILE}" +done From 51e122f40e0d2ad5f893c851ad4103a9fbafc0a1 Mon Sep 17 00:00:00 2001 From: ezhilsabareesh8 Date: Mon, 16 Dec 2024 16:07:53 +1100 Subject: [PATCH 10/14] Update README --- initial_conditions_WOA23/README | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/initial_conditions_WOA23/README b/initial_conditions_WOA23/README index 4ab38f1..766c7c3 100644 --- a/initial_conditions_WOA23/README +++ b/initial_conditions_WOA23/README @@ -4,6 +4,7 @@ This repository contains the tools and scripts to generate initial condition fil # Generate Initial Conditions -To generate initial condition files for a specific MOM ocean grid, execute the following script with the grid resolution as a command-line argument: +This script generates initial condition files for a specific MOM ocean grid using WOA23 data. The grid and data paths are provided as environment variables, execute the following script with the grid, input and output directories as a command-line argument: + +qsub -v GRIDDIR="",INPUT_DIR="",OUTPUT_DIR="" -P $PROJECT make_initial_conditions.sh -./make_initial_conditions.sh From 024f22c8dddd4e0b8f2d6e0dc821f1ec3c1dea8e Mon Sep 17 00:00:00 2001 From: ezhilsabareesh8 Date: Mon, 16 Dec 2024 16:28:13 +1100 Subject: [PATCH 11/14] add description --- setup_WOA_initial_conditions.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup_WOA_initial_conditions.py b/setup_WOA_initial_conditions.py index 5baf6d2..8c39655 100644 --- a/setup_WOA_initial_conditions.py +++ b/setup_WOA_initial_conditions.py @@ -6,6 +6,12 @@ ## ## #################################################### +# Description: +# This script processes WOA23 temperature and salinity data +# to create initial condition files. It combines applies masks +# to filter invalid data, calculates pressure, absolute salinity, +# and conservative temperature. + # import modules from glob import glob import os,sys From 74887ff95204bbe470590e85ace5e2cea13d49d7 Mon Sep 17 00:00:00 2001 From: ezhilsabareesh8 <108497463+ezhilsabareesh8@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:22:23 +1100 Subject: [PATCH 12/14] Create LICENSE --- LICENSE | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 08bbb5ea2930acada6e36e4e08a0cc4c5053bcd5 Mon Sep 17 00:00:00 2001 From: ezhilsabareesh8 Date: Wed, 18 Dec 2024 09:58:33 +1100 Subject: [PATCH 13/14] Add license headers and initialise source --- copy_to_input_rc.sh | 2 ++ finalise.sh | 2 ++ initial_conditions_WOA23/make_ic | 3 +++ inte.csh | 5 +++++ 4 files changed, 12 insertions(+) diff --git a/copy_to_input_rc.sh b/copy_to_input_rc.sh index cff977c..014d4b9 100755 --- a/copy_to_input_rc.sh +++ b/copy_to_input_rc.sh @@ -1,4 +1,6 @@ #!/usr/bin/env sh +# Copyright 2023 ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details. +# SPDX-License-Identifier: Apache-2.0 srcpath=/g/data/ik11/inputs/access-om3/woa23 dstpath=/g/data/ik11/inputs/access-om3/input_rc diff --git a/finalise.sh b/finalise.sh index 3707c57..f472ee6 100755 --- a/finalise.sh +++ b/finalise.sh @@ -1,4 +1,6 @@ #!/usr/bin/env sh +# Copyright 2023 ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details. +# SPDX-License-Identifier: Apache-2.0 # Commit changes and push, then add metadata to note how changes were made module load nco diff --git a/initial_conditions_WOA23/make_ic b/initial_conditions_WOA23/make_ic index 17526a4..bce493c 100755 --- a/initial_conditions_WOA23/make_ic +++ b/initial_conditions_WOA23/make_ic @@ -1,4 +1,7 @@ #!/bin/bash +# Copyright 2023 ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details. +# SPDX-License-Identifier: Apache-2.0 + #PBS -q normal #PBS -l mem=64Gb #PBS -l walltime=1:00:00 diff --git a/inte.csh b/inte.csh index 35b0e1b..027b770 100755 --- a/inte.csh +++ b/inte.csh @@ -1,5 +1,10 @@ #!/bin/csh -f +# Copyright 2023 ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details. +# SPDX-License-Identifier: Apache-2.0 +source /etc/profile.d/modules.csh + +module purge module use /g/data/hh5/public/modules module load conda/analysis3 module load nco From 3f0821ccc6f3d14d4dce26a688fd2161d8017dfa Mon Sep 17 00:00:00 2001 From: ezhilsabareesh8 Date: Wed, 18 Dec 2024 10:07:24 +1100 Subject: [PATCH 14/14] Add file description --- inte.csh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/inte.csh b/inte.csh index 027b770..2c948a6 100755 --- a/inte.csh +++ b/inte.csh @@ -2,6 +2,26 @@ # Copyright 2023 ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details. # SPDX-License-Identifier: Apache-2.0 +#================================================================== +# The meaning of woa23 data name: woa23_decav_sXX_04.nc +# XX: 00 means annual mean, the whole depth +# 01-12 means monthly mean, only upper 1500m +# 13-16 means seasonal mean, 13 for Winter, 14 for Spring, +# 15 for Summer, 16 for Autumn. +# 13-16 with the whole depth +# +# reproduce the monthly data based on seasonal data, then using +# the monthly mean data instead of data on the upper 1500m ocean. +# +# This script is doing: +# 1. extract the variable salinity 's_an' from seaonsal data +# to each month. +# 2. using 'ncks --mk_rec time' to add unlimited attribute of time. +# 3. rename salinity name from 's_an' to 'practical_salinity' +# 4. using 'setup_WOA_initial_conditions.py' to processing the +# conservative temperature. +#================================================================== + source /etc/profile.d/modules.csh module purge