Skip to content

Commit

Permalink
fix: add missing io domain for running with null model (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
rem1776 committed Oct 24, 2022
1 parent fd132e4 commit 7c47be3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: underwoo/ubuntu_libfms_gnu
image: noaagfdl/hpc-me.ubuntu-minimal:coupler
env:
CC: mpicc
FC: mpif90
Expand Down
5 changes: 5 additions & 0 deletions simple/ice_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,11 @@ subroutine ice_model_init ( Ice, Time_Init, Time, &
!enddo
!enddo

! set io domain if not there in order to check files
if ( .not. associated(mpp_get_io_domain(Ice%domain)) ) then
call mpp_define_io_domain(Ice%domain, (/ 1, 1 /) )
endif

! read the land mask from a file (land=1)
if (open_file(land_mask_fileobj, 'INPUT/land_mask.nc', 'read', Ice%domain)) then
call read_data (land_mask_fileobj, 'land_mask', Ice%glon)
Expand Down
37 changes: 23 additions & 14 deletions t/null_model_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ export PATH=${PATH}:${bld_dir}/mkmf/bin
mk_template=${bld_dir}/mkmf/templates/linux-ubuntu-xenial-gnu.mk

# FMS
git clone https://github.com/NOAA-GFDL/FMS.git $src_dir/FMS
if [ "$1" = "--local-fms" ]; then
test -d "../../../FMS" || echo "Error: --local-fms specified but FMS src not found in parent directory" 1>&2
cp -r ../../../FMS $src_dir/FMS
else
git clone https://github.com/NOAA-GFDL/FMS.git $src_dir/FMS
fi

# ocean_null
git clone https://github.com/NOAA-GFDL/ocean_null.git $src_dir/ocean_null
Expand Down Expand Up @@ -94,7 +99,7 @@ EOF
mkdir -p $bld_dir/fms
list_paths -o $bld_dir/fms/pathnames_fms $src_dir/FMS
cd $bld_dir/fms
mkmf -m Makefile -a $src_dir -b $bld_dir -p libfms.a -t $mkmf_template -g -c "-Duse_netCDF -Duse_libMPI -DMAXFIELDS_=200 -DMAXFIELDMETHODS_=200 -DINTERNAL_FILE_NML" -IFMS/include -IFMS/mpp/include $bld_dir/fms/pathnames_fms
mkmf -m Makefile -a $src_dir -b $bld_dir -p libfms.a -t $mkmf_template -g -c "-Duse_netCDF -Duse_libMPI -DMAXFIELDS_=200 -DMAXFIELDMETHODS_=200 -DINTERNAL_FILE_NML -DHAVE_GETTID" -IFMS/include -IFMS/mpp/include $bld_dir/fms/pathnames_fms
cd $bld_dir

# libocean_null
Expand Down Expand Up @@ -152,9 +157,9 @@ make -j NETCDF=3 DEBUG=on coupler_full_test.x
# Report on the status of the build
if [ $? -eq 0 ]
then
echo "<NOTE> : make succeeded - full coupler."
echo "::note title=Build Succeeded:: null model with full coupler built successfully."
else
echo "<NOTE> : make failed - full coupler."
echo "::error title=Build Failed:: null model with full coupler failed compilation."
exit 1
fi

Expand All @@ -164,13 +169,11 @@ make -j NETCDF=3 DEBUG=on coupler_simple_test.x
# Report on the status of the build
if [ $? -eq 0 ]
then
echo "<NOTE> : make succeeded - simple coupler."
echo "::note title=Build Succeeded:: null model with simple coupler built successfully."
else
echo "<NOTE> : make failed - simple coupler."
echo "::error title=Build Failed:: null model with simple coupler failed compilation."
exit 1
fi
### 17FEB2021 exit 0 to prevent model running. This is temporary
exit 0
# Run the null models test
# Setup the run directory
mkdir ${bld_dir}/run
Expand All @@ -184,15 +187,14 @@ tar zxf ${tarFile}
# Get the full namelist
ln -s input-full.nml input.nml
# Run the null model with the full coupler
### 17FEB2021 commented out the run because it crashes
#mpiexec -n 1 ${bld_dir}/coupler_full_test.x
mpiexec -n 1 ${bld_dir}/coupler_full_test.x

# Report on the status of the run with the full coupler
if [ $? -eq 0 ]
then
echo "<NOTE> : run succeeded - full coupler."
echo "::note title=Run Succeeded - full coupler:: Full coupler null model ran successfully."
else
echo "<NOTE> : run failed - full coupler."
echo "::error title=Run Failed - full coupler:: Full coupler null model run failed execution."
exit 1
fi

Expand All @@ -204,6 +206,13 @@ mkdir RESTART
rm input.nml
ln -s input-simple.nml input.nml
# Run the null simple coupler test
### 17FEB2021 commented out the run because it crashes
#mpiexec -n 1 ${bld_dir}/coupler_simple_test.x
mpiexec -n 1 ${bld_dir}/coupler_simple_test.x

# Report on the status of the run with the simple coupler
if [ $? -eq 0 ]
then
echo "::note title=Run Succeeded - simple coupler:: simple coupler null model ran successfully"
else
echo "::error title=Run Failed - simple coupler:: simple coupler null model run failed execution."
exit 1
fi

0 comments on commit 7c47be3

Please sign in to comment.