Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oifs48r1 standalone #1091

Merged
merged 37 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
094c4ba
minimal test setup
JanStreffing Oct 25, 2023
945057a
wip towards oifs48r1
JanStreffing Oct 26, 2023
aff3254
compiles
JanStreffing Oct 27, 2023
d29c920
wip compiling on levante; currently strange usr/bin/env/bash not foun…
JanStreffing Oct 30, 2023
f5be1bf
fix path bug
JanStreffing Oct 30, 2023
5ecaa6c
wip
JanStreffing Nov 1, 2023
62e1325
fix fort.4 48r1 template
JanStreffing Nov 3, 2023
e2f75fd
getting very close. fort.4 is ok, with default script. esm_tools scri…
JanStreffing Nov 4, 2023
e7d4d33
Merge branch 'release' into oifs48r1
JanStreffing Nov 7, 2023
482a984
working oifs48r1 runtime
JanStreffing Nov 7, 2023
28f9573
runscript cleanup
JanStreffing Nov 7, 2023
655f472
sort versions
JanStreffing Nov 7, 2023
0e47c09
this breaks the selection of iolibraries: system_gnu_libs, but I thin…
JanStreffing Nov 7, 2023
769b9c3
cleanup of oifs 48 env file
JanStreffing Nov 7, 2023
a292e1b
restore 43r3 restart timestep format
JanStreffing Nov 7, 2023
2496101
choose block for major version, so we don't need to repeat ourselfes
JanStreffing Nov 7, 2023
d23a119
add major version as an early var
JanStreffing Nov 7, 2023
6c5faf1
remove compile_infos from oifs.yaml so that the major_version variabl…
mandresm Nov 9, 2023
fe6339b
Merge branch 'fix/resolve_early_further_reading_and_early_version_in_…
mandresm Nov 9, 2023
2763e2b
Merge branch 'fix/resolve_early_further_reading_and_early_version_in_…
mandresm Nov 9, 2023
927c730
Merge pull request #1097 from esm-tools/oifs48r1_fix_further_reading_…
JanStreffing Nov 9, 2023
a87bcb8
adding daily icmcl split script, so that we can run arbitrary length …
JanStreffing Nov 9, 2023
5f463e9
Merge branch 'release' into oifs48r1
mandresm Nov 10, 2023
eb5f2e2
opticts
JanStreffing Dec 13, 2023
bdf1dfb
remove superfluous env changes that are already done in env yaml
JanStreffing Dec 13, 2023
995be4a
remove this relict. For more info see: https://github.com/esm-tools/e…
JanStreffing Dec 13, 2023
eecc2c9
turns out these are not needed anymore. See: https://github.com/esm-t…
JanStreffing Dec 13, 2023
2b6c3eb
adding system libs var for juwels
JanStreffing Dec 14, 2023
22d5584
Merge branch 'release' into oifs48r1
mandresm Dec 18, 2023
9d8d002
trying to fix restarts for oifs48r1
JanStreffing Dec 18, 2023
4e03b3e
fix restart syntaxt for oifs 48r1
JanStreffing Dec 18, 2023
88ef4b3
correct clean command
JanStreffing Jan 8, 2024
eb62ece
Merge branch 'release' into oifs48r1
mandresm Jan 15, 2024
3a4c5ca
cleaning up so that it hopefully works for users that have no pool di…
JanStreffing Jan 15, 2024
10af7a7
list in namelist without string symbols
JanStreffing Jan 15, 2024
b761778
short test
JanStreffing Jan 16, 2024
d8ed6cc
Bump version: 6.25.9 → 6.26.0
Jan 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions configs/components/oifs/append_daily_icmcl_file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/bin/bash

##
## Usage: ./oifs_change_dataDate_initfiles.sh MACHINE INDIR EXPID YYYY-MM-DDTHH:MM:SS YYYY-MM-DDTHH:MM:SS OUTDIR
## where EXPID is the 4-character experiment ID, e.g. gu5a if the filename is ICMGGgu5aINIT etc.
## YYYYMMDD is the new date you want to set in the grib files
## DIR is the location of the original data.
##

indir=$1
icmcl_file=$2
outexpid=$3
startdate=$4
enddate=$5
outdir=$6
pooldir=$7

source $indir/../../scripts/env.sh

echo " OpenIFS preprocessing "
echo " ===================== "
echo " "
echo " Machine: $(hostname) "
echo " grib_set: $(which grib_set) "
echo " "
echo " Working dir $(pwd)"
echo " Input dir: $indir "
echo " Output dir: $outdir "
echo " Exp ID: $expid "
echo " Start date: $startdate "
echo " End date: $enddate "

startyear=$(date -u -d "${startdate}" +%Y)
endyear=$(date -u -d "${enddate}" +%Y)

echo " Start year: $startyear "
echo " End year: $endyear "
echo " "

echo " *Using grib_ls to extract the dataDates of original ICMCL file"
grib_copy -w shortName=lai_lv ${icmcl_file} $outdir/ICMCL_for_dataDate_list
dataDate_list=$(grib_ls -p dataDate $outdir/ICMCL_for_dataDate_list | tail -n +3 | head -n -3)

echo " *Checking if original ICMCL file has already been cut"
exists=1
for dataDate in $dataDate_list; do
if [ ! -e "$pooldir/icmcl/ICMCL_$dataDate" ]; then
exists=0
fi
done

if [ "$exists" -eq 0 ]; then
echo " *Cutting original ICMCL file into daily files"
mkdir -p $outdir/icmcl/
for dataDate in $dataDate_list; do
echo "grib_copy -w dataDate=$dataDate ${icmcl_file} $outdir/icmcl/ICMCL_$dataDate"
grib_copy -w dataDate=$dataDate ${icmcl_file} $outdir/icmcl/ICMCL_$dataDate &
done
wait
else
echo " *Orinal ICMCL file is already cut into daily files; linking"
ln -s $pooldir/icmcl $outdir/
fi

orig_year=${dataDate:0:4}

echo " *Creating ICMCL files for all days, months & years needed for run"
filelist=" "
for ((y = $startyear ; y < $(($endyear+1)) ; y++)); do
# Figure out if leap year
if [ $((y % 4)) -eq 0 ] && [ $((y % 100)) -ne 0 ] || [ $((y % 400)) -eq 0 ]; then
leapyear=1
else
leapyear=0
fi
for ((m = 1 ; m < 13 ; m++)); do
# Set number of days per month
if [ "$m" -eq 4 ] || [ "$m" -eq 6 ] || [ "$m" -eq 9 ] || [ "$m" -eq 11 ]; then
day_per_month=30
elif [ "$m" -eq 1 ] || [ "$m" -eq 3 ] || [ "$m" -eq 5 ] || [ "$m" -eq 7 ] || [ "$m" -eq 8 ] || [ "$m" -eq 10 ] || [ "$m" -eq 12 ]; then
day_per_month=31
elif [ "$m" -eq 2 ]; then
if [ "$leapyear" -eq 1 ]; then
day_per_month=29
else
day_per_month=28
fi
fi
# Create files with correct dates
for ((d = 1 ; d < $((day_per_month+1)) ; d++)); do
grib_set -s dataDate=$(printf "%04d" $y)$(printf "%02d" $m)$(printf "%02d" $d) $outdir/icmcl/ICMCL_$orig_year$(printf "%02d" $m)$(printf "%02d" $d) $outdir/icmcl/ICMCL_$(printf "%04d" $y)$(printf "%02d" $m)$(printf "%02d" $d) &
export filelist="$filelist $outdir/icmcl/ICMCL_$(printf "%04d" $y)$(printf "%02d" $m)$(printf "%02d" $d)"
done
done
done
wait

echo " *Mergeing daily ICMCL files into single file"
rm -f ${outdir}/ICMCL${outexpid}INIT
grib_copy $filelist ${outdir}/ICMCL${outexpid}INIT

if [ "$exists" -eq 0 ]; then
if [ -w "$pooldir" ]; then
echo " *Storing original ICMCL cut into daily files to $pooldir/icmcl"
mkdir -p $pooldir/icmcl
for dataDate in $dataDate_list; do
mv $outdir/icmcl/ICMCL_$dataDate $pooldir/icmcl/ &
done
wait
fi
else
echo " *Cleaning up daily original files"
for dataDate in $dataDate_list; do
rm $outdir/icmcl/ICMCL_$dataDate &
done
wait
fi
echo " *Cleaning up temporary files"
rm -rf $filelist $outdir/icmcl $outdir/ICMCL_for_dataDate_list

45 changes: 45 additions & 0 deletions configs/components/oifs/link_icmcl_file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

##
## Usage: ./oifs_change_dataDate_initfiles.sh MACHINE INDIR EXPID YYYY-MM-DDTHH:MM:SS YYYY-MM-DDTHH:MM:SS OUTDIR
## where EXPID is the 4-character experiment ID, e.g. gu5a if the filename is ICMGGgu5aINIT etc.
## YYYYMMDD is the new date you want to set in the grib files
## DIR is the location of the original data.
##

indir=$1
icmcl_file=$2
outexpid=$3
startdate=$4
enddate=$5
outdir=$6

source $indir/../../scripts/env.sh

echo " OpenIFS preprocessing "
echo " ===================== "
echo " "
echo " Machine: $(hostname) "
echo " grib_set: $(which grib_set) "
echo " cdo -V: "
cdo -V
echo " "
echo " Input dir: $indir "
echo " Output dir: $outdir "
echo " Exp ID: $expid "
echo " Start date: $startdate "
echo " End date: $enddate "

starttime=$(date -u -d "${startdate}" +%Y-%m-%dT%T)
endtime=$(date -u -d "${enddate}" +%Y-%m-%dT%T)

echo " Start time: $starttime "
echo " End time: $endtime "
echo " "

echo " * Link ICMCL file "
ln -s ${icmcl_file} ${outdir}/ICMCL${outexpid}INIT
mandresm marked this conversation as resolved.
Show resolved Hide resolved




Loading