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

Add sub-regioan diag output example in 1D case #39

Merged
merged 36 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
5d95fa4
add src/libyaml
yichengt900 May 14, 2024
49de077
update build script for yaml support
yichengt900 May 14, 2024
df00d93
fix build script for libyaml link
yichengt900 May 14, 2024
95c2dec
update 1d case with regional diag output example
yichengt900 May 14, 2024
2c6f777
update build script
yichengt900 May 14, 2024
6818ca0
debugging
yichengt900 May 14, 2024
289e705
forget add diag_table.yaml
yichengt900 May 15, 2024
7c6a569
Update docker scirpt to include FRE NC Tool; Update docs
yichengt900 May 15, 2024
2fa51ac
Update MOM6 tag
yichengt900 May 16, 2024
96ab007
Add example xml for new diag manager
yichengt900 May 16, 2024
7dc39c4
Merge branch 'main' into fix/fms2_nudge
yichengt900 May 16, 2024
7b8e606
remove unused GHA workflow
yichengt900 May 16, 2024
b0a3e79
Update MOM6 tag for USE_GRID_SPACE_DIAGNOSTIC_AXES fix
yichengt900 May 22, 2024
84c0e5a
update MOM6 tag to inlclude diag_send_complete commit
yichengt900 May 31, 2024
7a8c843
Again update MOM6 tag
yichengt900 May 31, 2024
229ef03
Update NWA12.COBALT ref path
yichengt900 May 31, 2024
345313b
Update FMS to 2024.01.01
yichengt900 May 31, 2024
5d67e79
add parameter_doc files
yichengt900 Jun 1, 2024
763b36c
Merge branch 'main' into fix/fms2_nudge
yichengt900 Jun 1, 2024
0e9748e
Merged main and accepted main branch version of src/libyaml submodule
yichengt900 Jun 1, 2024
d356d58
update xml
yichengt900 Jun 1, 2024
7f06184
fix xml restart RT test
yichengt900 Jun 1, 2024
87c50c9
Merge branch 'main' into fix/fms2_nudge
yichengt900 Jun 1, 2024
1533f68
Update MOM6 tag that contains nudge fix and kpapa shear rescaling
yichengt900 Jun 3, 2024
4888e0c
Merge branch 'main' into fix/fms2_nudge
yichengt900 Jun 4, 2024
6272c28
Merge branch 'main' into fix/fms2_nudge
yichengt900 Jun 10, 2024
494c6a5
Merge branch 'main' into fix/fms2_nudge
yichengt900 Jun 11, 2024
6e1f516
Merge branch 'main' into fix/fms2_nudge
yichengt900 Jun 12, 2024
9892a7b
Merge branch 'main' into fix/fms2_nudge
yichengt900 Jun 13, 2024
624a4a2
Merge remote-tracking branch 'origin' into fix/fms2_nudge
yichengt900 Jun 14, 2024
82dcc39
Update CEFI_NWA12_cobalt_fms2_yaml.xml
yichengt900 Jun 14, 2024
aa9f848
Merge branch 'main' into fix/fms2_nudge
yichengt900 Jun 15, 2024
28fd9f8
fix ice_param tag in xml
yichengt900 Jun 18, 2024
db1b1ab
Merge branch 'main' into fix/fms2_nudge
yichengt900 Jun 18, 2024
32b39e5
Update diag_table_COBALT_2023-04
yichengt900 Jun 26, 2024
c15aff9
Merge branch 'main' into fix/fms2_nudge
yichengt900 Jun 26, 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
8 changes: 6 additions & 2 deletions .github/workflows/mom6_cobalt_1D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ jobs:
- name: Build mom6-sis2-cobalt
working-directory: ./builds
run: |
apt update; apt install -y wget
echo "build mom6-sis2-cobalt ..."
./linux-build.bash -m docker -p linux-gnu -t debug -f mom6sis2
./linux-build.bash -m docker -p linux-gnu -t debug -f mom6sis2_yaml

- name: Download 1d model dataset
working-directory: ./exps
Expand All @@ -42,6 +41,11 @@ jobs:
run: |
./driver.sh

- name: Run mppnccombine to combine sub-region diag outputs
working-directory: ./exps/OM4.single_column.COBALT
run: |
/opt/bin/mppnccombine -64 -h 16384 -m -k 100 20040102.ocean_daily_subset.nc 20040102.ocean_daily_subset.nc.00*

- name: Check ref
working-directory: ./exps/OM4.single_column.COBALT
run: |
Expand Down
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
path = src/libyaml
url = https://github.com/yaml/libyaml.git
branch = master
[submodule "src/MOM6"]
path = src/MOM6
url = https://github.com/NOAA-CEFI-Regional-Ocean-Modeling/MOM6.git
branch = dev/cefi
[submodule "src/FMS"]
path = src/FMS
url = https://github.com/NOAA-GFDL/FMS.git
branch = 2024.01.02
[submodule "src/MOM6"]
path = src/MOM6
url = https://github.com/NOAA-CEFI-Regional-Ocean-Modeling/MOM6.git
branch = dev/cefi
[submodule "src/coupler"]
path = src/coupler
url = https://github.com/NOAA-GFDL/FMScoupler.git
Expand Down
50 changes: 50 additions & 0 deletions builds/linux-build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,56 @@ fi

make $makeflags MOM6SIS2

elif [[ $flavor == "mom6sis2_yaml" ]]; then

echo "build mom6sis2 with FMS2 cap and yaml"

[[ -d build/$machine_name-$platform/libyaml/$target ]] && rm -rf build/$machine_name-$platform/libyaml/$target
mkdir -p build/$machine_name-$platform/libyaml/$target
pushd $srcdir/libyaml
$srcdir/libyaml/bootstrap
$srcdir/libyaml/configure --prefix=$abs_rootdir/build/$machine_name-$platform/libyaml/$target
make
make install

if [ $? -ne 0 ]; then
echo "Could not build the libyaml library!"
exit 1
fi
popd

mkdir -p build/$machine_name-$platform/shared/$target
pushd build/$machine_name-$platform/shared/$target
rm -f path_names
$srcdir/mkmf/bin/list_paths $srcdir/FMS/{affinity,amip_interp,column_diagnostics,diag_integral,drifters,horiz_interp,memutils,sat_vapor_pres,topography,astronomy,constants,diag_manager,field_manager,include,monin_obukhov,platform,tracer_manager,axis_utils,coupler,fms,fms2_io,interpolator,mosaic,mosaic2,random_numbers,time_interp,tridiagonal,block_control,data_override,exchange,mpp,time_manager,string_utils,parser}/ $srcdir/FMS/libFMS.F90
$srcdir/mkmf/bin/mkmf -t $abs_rootdir/$machine_name/$platform.mk -o "-I../../libyaml/$target/include" -p libfms.a -l "-L../../libyaml/$target/lib -lyaml $linker_options" -c "-Duse_libMPI -Duse_yaml -Duse_netCDF -DMAXFIELDMETHODS_=800" path_names

make $makeflags libfms.a

if [ $? -ne 0 ]; then
echo "Could not build the FMS library!"
exit 1
fi

popd

mkdir -p build/$machine_name-$platform/ocean_ice/$target
pushd build/$machine_name-$platform/ocean_ice/$target
rm -f path_names
$srcdir/mkmf/bin/list_paths $srcdir/MOM6/{config_src/infra/FMS2,config_src/memory/dynamic_symmetric,config_src/drivers/FMS_cap,config_src/external/ODA_hooks,config_src/external/database_comms,config_src/external/drifters,config_src/external/stochastic_physics,pkg/GSW-Fortran/{modules,toolbox}/,src/{*,*/*}/} $srcdir/SIS2/{config_src/dynamic_symmetric,config_src/external/Icepack_interfaces,src} $srcdir/icebergs/src $srcdir/FMS/{coupler,include}/ $srcdir/{ocean_BGC/generic_tracers,ocean_BGC/mocsy/src}/ $srcdir/{atmos_null,ice_param,land_null,coupler/shared/,coupler/full/}/


compiler_options='-DINTERNAL_FILE_NML -DUSE_FMS2_IO -Duse_yaml -DMAX_FIELDS_=600 -DNOT_SET_AFFINITY -D_USE_MOM6_DIAG -D_USE_GENERIC_TRACER -DUSE_PRECISION=2 -D_USE_LEGACY_LAND_ -Duse_AM3_physics'
linker_options=''
if [[ "$target" =~ "stdpar" ]] ; then
compiler_options="$compiler_options -stdpar -Minfo=accel"
linker_options="$linker_options -stdpar "
fi

$srcdir/mkmf/bin/mkmf -t $abs_rootdir/$machine_name/$platform.mk -o "-I../../shared/$target -I../../libyaml/$target/include" -p MOM6SIS2 -l "-L../../shared/$target -lfms -L../../libyaml/$target/lib -lyaml $linker_options" -c "$compiler_options" path_names

make $makeflags MOM6SIS2

elif [[ $flavor == "fms1_mom6sis2" ]]; then

echo "build mom6sis2 with FMS1 cap"
Expand Down
2 changes: 2 additions & 0 deletions docs/source/InputsOutputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ Model output is controlled via the FMS diag_manager using the ``diag_table``.

The diag_table file has three kinds of section: Title, File and Field. The title section is mandatory and always the first. There can be multiple file and field sections typically either in pairs or grouped in to all files and all fields, but always with the file section preceding the corresponding field section.

The new FMS2 comes with a new rewritten diag manager. The old diag_manager code has been kept intact and will be used by default. The rewritten diag manager can be enabled via ``use_modern_diag = .true.`` to your ``diag_manager_nml``. Keep in mind that the rewritten diag manager only supports the YAML format of diag_Table (this requires the additional third-party libyaml when building FMS2). Users can refer to `this page <https://github.com/NOAA-GFDL/FMS/blob/main/diag_manager/diag_yaml_format.md>`__ for more details of the diag_table yaml format. An example diag_table.yaml can be found in our 1D case: ``exps/OM4.single_column.COBALT/diag_table.yaml``.

.. _TitleSec:

---------------------------
Expand Down
21 changes: 21 additions & 0 deletions exps/OM4.single_column.COBALT/diag_table.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
title: test_diag_manager
base_date: 1993 1 1 0 0 0
diag_files:
- file_name: ocean_daily_subset
time_units: days
unlimdim: time
is_ocean: true
freq: 1 days
varlist:
- module: ocean_model
var_name: thetao
reduction: average
kind: r4
sub_region:
- grid_type: index
tile: 1
corner1: 2,2
corner2: 3,2
corner3: 2,3
corner4: 3,3

5 changes: 5 additions & 0 deletions exps/OM4.single_column.COBALT/driver.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

#
export LD_LIBRARY_PATH=../../builds/build/docker-linux-gnu/libyaml/debug/lib:$LD_LIBRARY_PATH
rm -rf RESTART*

#
Expand All @@ -11,6 +12,7 @@ echo "run 48hrs test ..."
ln -fs input.nml_48hr input.nml
mpirun --allow-run-as-root -np 1 ../../builds/build/docker-linux-gnu/ocean_ice/debug/MOM6SIS2 > out1 2>err1
tail out1
tail err1
mv RESTART RESTART_48hrs
mv ocean.stats* RESTART_48hrs

Expand All @@ -19,6 +21,7 @@ echo "run 24hrs test ..."
ln -fs input.nml_24hr input.nml
mpirun --allow-run-as-root -np 1 ../../builds/build/docker-linux-gnu/ocean_ice/debug/MOM6SIS2 > out2 2>err2
tail out2
tail err2
mv RESTART RESTART_24hrs
mv ocean.stats* RESTART_24hrs

Expand All @@ -33,8 +36,10 @@ echo "run 24hrs rst test ..."
ln -fs input.nml_24hr_rst input.nml
mpirun --allow-run-as-root -np 1 ../../builds/build/docker-linux-gnu/ocean_ice/debug/MOM6SIS2 > out3 2>err3
tail out3
tail err3
mv RESTART RESTART_24hrs_rst
mv ocean.stats* RESTART_24hrs_rst
[[ ! -f 20040102.ocean_daily_subset.nc.0000 ]] && echo "Can not find sub-region diag output! Exit!" && exit 1

# Define the directories containing the files
DIR1="RESTART_24hrs_rst/"
Expand Down
1 change: 1 addition & 0 deletions exps/OM4.single_column.COBALT/input.nml_24hr_rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
max_input_fields = 2000
max_output_fields = 5000
mix_snapshot_average_fields=.false.
use_modern_diag=.true.
/

&flux_exchange_nml
Expand Down
Loading