Skip to content

Commit

Permalink
Merge branch 'NOAA-GFDL:main' into flexible_dm
Browse files Browse the repository at this point in the history
  • Loading branch information
uramirez8707 authored Oct 9, 2024
2 parents 39983b3 + 2b05550 commit e1f62ca
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 48 deletions.
18 changes: 9 additions & 9 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# These owners will be the default owners for all the files in the
# repository. Unless a later match is found, these owners
# will be requested for a review when a PR is opened.
* @thomas-robinson @bensonr @rem1776
* @uramirez8707 @bensonr @rem1776

# GNU autotools files
Makefile.am @uramirez8707 @rem1776
Expand All @@ -41,7 +41,7 @@ cmake @mlee03
/.github/ @rem1776

# Testing files
/test_fms/ @uramirez8707 @mlee03 @bensonr @thomas-robinson @rem1776
/test_fms/ @uramirez8707 @mlee03 @bensonr @rem1776

# Specific component directories
/affinity/ @bensonr
Expand All @@ -53,15 +53,15 @@ cmake @mlee03
#/data_override/ Currently no code owner
/test_fms/data_override/ @rem1776

/diag_manager @thomas-robinson
/test_fms/diag_manager/ @thomas-robinson
/diag_manager @uramirez8707
/test_fms/diag_manager/ @uramirez8707

/fms/ @thomas-robinson @rem1776
/test_fms/fms/ @thomas-robinson @rem1776
/fms/ @uramirez8707 @rem1776
/test_fms/fms/ @uramirez8707 @rem1776
/fms2/ @uramirez8707
/test_fms/fms2/ @uramirez8707

/libFMS/ @thomas-robinson @rem1776
/libFMS/ @uramirez8707 @rem1776

/mpp/ @thomas-robinson @bensonr
/test_fms/mpp/ @thomas-robinson @bensonr @rem1776
/mpp/ @uramirez8707 @bensonr
/test_fms/mpp/ @uramirez8707 @bensonr @rem1776
18 changes: 16 additions & 2 deletions test_fms/data_override/test_data_override2_mono.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
output_dir
[ ! -d "INPUT" ] && mkdir -p "INPUT"

cat <<_EOF > input.nml
cat <<_EOF > input_base.nml
&test_data_override_ongrid_nml
test_case = 2
write_only = .False.
/
_EOF

Expand All @@ -41,16 +42,23 @@ _EOF
for KIND in r4 r8
do
rm -rf INPUT/*
sed 's/write_only = .False./write_only = .True./g' input_base.nml > input.nml
test_expect_success "Creating input files (${KIND})" '
mpirun -n 6 ../test_data_override_ongrid_${KIND}
'

cp input_base.nml input.nml
test_expect_success "test_data_override with monotonically increasing and decreasing data sets (${KIND})" '
mpirun -n 6 ../test_data_override_ongrid_${KIND}
'
done

rm -rf data_table

cat <<_EOF > input.nml
cat <<_EOF > input_base.nml
&test_data_override_ongrid_nml
test_case = 2
write_only = .False.
/
&data_override_nml
use_data_table_yaml = .True.
Expand Down Expand Up @@ -80,6 +88,12 @@ if [ -z $parser_skip ]; then
for KIND in r4 r8
do
rm -rf INPUT/*
sed 's/write_only = .False./write_only = .True./g' input_base.nml > input.nml
test_expect_success "Creating input files (${KIND})" '
mpirun -n 6 ../test_data_override_ongrid_${KIND}
'

cp input_base.nml input.nml
test_expect_success "test_data_override with monotonically increasing and decreasing data sets -yaml (${KIND})" '
mpirun -n 6 ../test_data_override_ongrid_${KIND}
'
Expand Down
10 changes: 8 additions & 2 deletions test_fms/data_override/test_data_override2_ongrid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ use_data_table_yaml=.False.
&test_data_override_ongrid_nml
nhalox=halo_size
nhaloy=halo_size
write_only = .False.
/
_EOF
printf '"OCN", "runoff", "runoff", "./INPUT/runoff.daitren.clim.1440x1080.v20180328.nc", "none" , 1.0' | cat > data_table
Expand All @@ -48,6 +49,7 @@ use_data_table_yaml=.True.
&test_data_override_ongrid_nml
nhalox=halo_size
nhaloy=halo_size
write_only = .False.
/
_EOF
cat <<_EOF > data_table.yaml
Expand All @@ -65,13 +67,17 @@ fi
[ ! -d "INPUT" ] && mkdir -p "INPUT"
for KIND in r4 r8
do
rm -rf INPUT/*
sed -e 's/halo_size/2/g ; s/write_only = .False./write_only = .True./g' input_base.nml > input.nml

test_expect_success "Creating input files (${KIND})" '
mpirun -n 6 ../test_data_override_ongrid_${KIND}
'

sed 's/halo_size/2/g' input_base.nml > input.nml
test_expect_success "data_override on grid with 2 halos in x and y (${KIND})" '
mpirun -n 6 ../test_data_override_ongrid_${KIND}
'

rm -rf INPUT/*
sed 's/halo_size/0/g' input_base.nml > input.nml
test_expect_success "data_override on grid with 0 halos in x and y (${KIND})" '
mpirun -n 6 ../test_data_override_ongrid_${KIND}
Expand Down
12 changes: 10 additions & 2 deletions test_fms/data_override/test_data_override2_scalar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,24 @@ output_dir
rm -rf data_table data_table.yaml input.nml input_base.nml

if [ ! -z $parser_skip ]; then
cat <<_EOF > input.nml
cat <<_EOF > input_base.nml
&data_override_nml
use_data_table_yaml=.False.
/
&test_data_override_ongrid_nml
test_case = 3
write_only = .False.
/
_EOF
printf '"OCN", "co2", "co2", "./INPUT/scalar.nc", "none" , 1.0' | cat > data_table
else
cat <<_EOF > input.nml
cat <<_EOF > input_base.nml
&data_override_nml
use_data_table_yaml=.True.
/
&test_data_override_ongrid_nml
test_case = 3
write_only = .False.
/
_EOF
cat <<_EOF > data_table.yaml
Expand All @@ -62,6 +64,12 @@ fi
for KIND in r4 r8
do
rm -rf INPUT/*
sed 's/write_only = .False./write_only = .True./g' input_base.nml > input.nml
test_expect_success "Creating input files (${KIND})" '
mpirun -n 6 ../test_data_override_ongrid_${KIND}
'

cp input_base.nml input.nml
test_expect_success "data_override scalar field (${KIND})" '
mpirun -n 6 ../test_data_override_ongrid_${KIND}
'
Expand Down
68 changes: 36 additions & 32 deletions test_fms/data_override/test_data_override_ongrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ program test_data_override_ongrid
use netcdf, only: nf90_create, nf90_def_dim, nf90_def_var, nf90_enddef, nf90_put_var, &
nf90_close, nf90_put_att, nf90_clobber, nf90_64bit_offset, nf90_char, &
nf90_double, nf90_unlimited
use fms_mod, only: string
use fms_mod, only: string, fms_init, fms_end

implicit none

Expand All @@ -53,10 +53,11 @@ program test_data_override_ongrid
integer, parameter :: scalar = 3
integer, parameter :: weight_file = 4
integer :: test_case = ongrid
logical :: write_only=.false. !< True if creating the input files only

namelist / test_data_override_ongrid_nml / nhalox, nhaloy, test_case, nlon, nlat, layout
namelist / test_data_override_ongrid_nml / nhalox, nhaloy, test_case, nlon, nlat, layout, write_only

call mpp_init
call fms_init
call fms2_io_init

read (input_nml_file, test_data_override_ongrid_nml, iostat=io_status)
Expand All @@ -75,35 +76,38 @@ program test_data_override_ongrid
call mpp_define_io_domain(Domain, (/1,1/))
call mpp_get_data_domain(Domain, is, ie, js, je)

select case (test_case)
case (ongrid)
call generate_ongrid_input_file ()
case (bilinear)
call generate_bilinear_input_file ()
case (scalar)
call generate_scalar_input_file ()
case (weight_file)
call generate_weight_input_file ()
end select

call mpp_sync()
call mpp_error(NOTE, "Finished creating INPUT Files")

!< Initiliaze data_override
call data_override_init(Ocean_domain_in=Domain, mode=lkind)

select case (test_case)
case (ongrid)
call ongrid_test()
case (bilinear)
call bilinear_test()
case (scalar)
call scalar_test()
case (weight_file)
call weight_file_test()
end select

call mpp_exit
if (write_only) then
select case (test_case)
case (ongrid)
call generate_ongrid_input_file ()
case (bilinear)
call generate_bilinear_input_file ()
case (scalar)
call generate_scalar_input_file ()
case (weight_file)
call generate_weight_input_file ()
end select

call mpp_sync()
call mpp_error(NOTE, "Finished creating INPUT Files")

else
!< Initiliaze data_override
call data_override_init(Ocean_domain_in=Domain, mode=lkind)

select case (test_case)
case (ongrid)
call ongrid_test()
case (bilinear)
call bilinear_test()
case (scalar)
call scalar_test()
case (weight_file)
call weight_file_test()
end select
endif

call fms_end

contains

Expand Down
10 changes: 9 additions & 1 deletion test_fms/data_override/test_data_override_weights.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ data_table:
factor: 1.0
_EOF

cat <<_EOF > input.nml
cat <<_EOF > input_base.nml
&data_override_nml
use_data_table_yaml = .True.
/
Expand All @@ -58,6 +58,7 @@ cat <<_EOF > input.nml
nlon = 5
nlat = 6
layout = 1, 2
write_only = .False.
/
_EOF

Expand All @@ -66,6 +67,13 @@ if [ -z $parser_skip ]; then
for KIND in r4 r8
do
rm -rf INPUT/.

sed 's/write_only = .False./write_only = .True./g' input_base.nml > input.nml
test_expect_success "Creating input files (${KIND})" '
mpirun -n 2 ../test_data_override_ongrid_${KIND}
'

cp input_base.nml input.nml
test_expect_success "test_data_override with and without weight files -yaml (${KIND})" '
mpirun -n 2 ../test_data_override_ongrid_${KIND}
'
Expand Down

0 comments on commit e1f62ca

Please sign in to comment.