Skip to content

Commit

Permalink
Merge pull request #579 from NOAA-GFDL/candidate-dev-master-2017-08-17
Browse files Browse the repository at this point in the history
  • Loading branch information
adcroft authored Aug 22, 2017
2 parents ae22a0f + da8f186 commit da77242
Show file tree
Hide file tree
Showing 95 changed files with 12,043 additions and 2,410 deletions.
170 changes: 117 additions & 53 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,138 +1,202 @@
stages:
- merge
- setup
- merge+setup
- builds
- run
- tests
- cleanup

# Moves to re-used workspace
# Merges MOM6 with dev/gfdl. Changes directory to test directory, if it exists.
before_script:
- MOM6_SRC=$CI_PROJECT_DIR
- WORKSPACE=`pwd | sed 's:/[0-9]/:/:'`
- git pull --no-edit https://github.com/NOAA-GFDL/MOM6.git dev/gfdl
- test -d $WORKSPACE/tests && cd $WORKSPACE/tests
- CACHE_DIR=/lustre/f1/oar.gfdl.ogrp-account/runner/cache/
- git pull --no-edit https://github.com/NOAA-GFDL/MOM6.git dev/gfdl && git submodule init && git submodule update
- pwd ; ls

# Merge
# Tests that merge with dev/gfdl works.
merge:
stage: merge
stage: merge+setup
tags:
- ncrc3
script:
- cd $CI_PROJECT_DIR
- pwd ; ls
- git pull --no-edit https://github.com/NOAA-GFDL/MOM6.git dev/gfdl

# Clones regression repo, if necessary, pulls latest of everything, and sets up working space
setup:
stage: setup
stage: merge+setup
tags:
- ncrc3
script:
- mkdir -p $WORKSPACE && cd $WORKSPACE
- ln -sf $MOM6_SRC/{config_src,src,pkg} .
- test -d tests || (git clone --recursive http://gitlab.gfdl.noaa.gov/ogrp/Gaea_c3-stats-MOM6-examples.git tests)
- cd tests
- git checkout . && git checkout dev/gfdl
- git pull
- git status
- bash Gitlab/before_script.sh
- (cd MOM6-examples/src/mkmf && git pull https://github.com/adcroft/mkmf.git add_coverage_mode)
- pwd ; ls
# Clone regressions directory
- git clone --recursive http://gitlab.gfdl.noaa.gov/ogrp/Gaea_c3-stats-MOM6-examples.git tests && cd tests
# Install / update testing scripts
- git clone https://github.com/adcroft/MRS.git MRS
# Update MOM6-examples and submodules
- (cd MOM6-examples && git checkout . && git checkout dev/gfdl && git pull && git submodule init && git submodule update)
- test -d MOM6-examples/src/LM3 || make -f MRS/Makefile.clone clone_gfdl -s
- make -f MRS/Makefile.clone MOM6-examples/.datasets -s
#- (cd MOM6-examples/src/mkmf && git pull https://github.com/adcroft/mkmf.git add_coverage_mode)
- env > gitlab_session.log
- cd ../ ; time tar zcf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz tests

# Compiles
gnu:repro:
stage: builds
tags:
- ncrc3
script:
- make -f Gitlab/Makefile.build MOM6_SRC=../ build_gnu -s -j
- make -f Gitlab/Makefile.build MOM6_SRC=../ static_gnu -s -j #coverage_gnu
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- time make -f MRS/Makefile.build MOM6_SRC=../ build_gnu -s -j
- time make -f MRS/Makefile.build MOM6_SRC=../ static_gnu -s -j
- time tar zvcf $CACHE_DIR/build-gnu-repro-$CI_PIPELINE_ID.tgz `find build/gnu -name MOM6`

intel:repro:
stage: builds
tags:
- ncrc3
script:
- make -f Gitlab/Makefile.build MOM6_SRC=../ build_intel -s -j
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- make -f MRS/Makefile.build MOM6_SRC=../ build_intel -s -j
- time tar zvcf $CACHE_DIR/build-intel-repro-$CI_PIPELINE_ID.tgz `find build/intel -name MOM6`

pgi:repro:
stage: builds
tags:
- ncrc3
script:
- make -f Gitlab/Makefile.build MOM6_SRC=../ build_pgi -s -j
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- make -f MRS/Makefile.build MOM6_SRC=../ build_pgi -s -j
- time tar zvcf $CACHE_DIR/build-pgi-repro-$CI_PIPELINE_ID.tgz `find build/pgi -name MOM6`

gnu:debug:
stage: builds
tags:
- ncrc3
script:
- make -f Gitlab/Makefile.build MOM6_SRC=../ debug_gnu -s -j
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- make -f MRS/Makefile.build MOM6_SRC=../ debug_gnu -s -j
- time tar zvcf $CACHE_DIR/build-gnu-debug-$CI_PIPELINE_ID.tgz `find build/gnu -name MOM6`

# Runs
run:
stage: run
tags:
- ncrc3
script:
- rm -f MOM6-examples/*.tar
- bash Gitlab/run_stage.sh
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- time tar zxf $CACHE_DIR/build-gnu-repro-$CI_PIPELINE_ID.tgz
- time tar zxf $CACHE_DIR/build-intel-repro-$CI_PIPELINE_ID.tgz
- time tar zxf $CACHE_DIR/build-pgi-repro-$CI_PIPELINE_ID.tgz
# time tar zxf $CACHE_DIR/build-gnu-debug-$CI_PIPELINE_ID.tgz
- echo "make -f MRS/Makefile.tests all -B" > job.sh
- msub -l partition=c3,nodes=29,walltime=00:24:00,qos=norm -q debug -S /bin/tcsh -j oe -A gfdl_o -z -o log.$CI_PIPELINE_ID -N mom6_regression -K job.sh
- cat log.$CI_PIPELINE_ID
- time tar zvcf $CACHE_DIR/results-$CI_PIPELINE_ID.tgz *.tar.gz

# Tests
gnu:regressions:
gnu:non-symmetric:
stage: tests
tags:
- ncrc3
script:
- cd regressions && git checkout .
- md5sum `find . -name ocean.stats.gnu` > all_gnu.md5 && find . -name ocean.stats.gnu -exec rm {} \;
- echo "Regression results for non-symmetric gnu executables"
- tar xf ../MOM6-examples/non_symmetric_gnu.tar && md5sum -c all_gnu.md5 && rm all_gnu.md5
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- time tar zxf $CACHE_DIR/results-$CI_PIPELINE_ID.tgz
- make -f MRS/Makefile.tests gnu_non_symmetric

intel:regressions:
intel:non-symmetric:
stage: tests
tags:
- ncrc3
script:
- cd regressions && git checkout .
- md5sum `find . -name ocean.stats.intel` > all_intel.md5 && find . -name ocean.stats.intel -exec rm {} \;
- echo "Regression results for non-symmetric intel executables"
- tar xf ../MOM6-examples/non_symmetric_intel.tar && md5sum -c all_intel.md5 && rm all_intel.md5
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- time tar zxf $CACHE_DIR/results-$CI_PIPELINE_ID.tgz
- make -f MRS/Makefile.tests intel_non_symmetric

pgi:regressions:
pgi:non-symmetric:
stage: tests
tags:
- ncrc3
script:
- cd regressions && git checkout .
- md5sum `find . -name ocean.stats.pgi` > all_pgi.md5 && find . -name ocean.stats.pgi -exec rm {} \;
- echo "Regression results for non-symmetric pgi executables"
- tar xf ../MOM6-examples/non_symmetric_pgi.tar && md5sum -c all_pgi.md5 && rm all_pgi.md5
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- time tar zxf $CACHE_DIR/results-$CI_PIPELINE_ID.tgz
- make -f MRS/Makefile.tests pgi_non_symmetric

gnu:symmetric:
stage: tests
tags:
- ncrc3
script:
- mkdir -p _gnu && cd _gnu
- tar xf ../MOM6-examples/non_symmetric_gnu.tar && md5sum `find . -name ocean.stats.gnu` > all_gnu.md5 && find . -name ocean.stats.gnu -exec rm {} \;
- echo "Regression results for symmetric executables"
- tar xf ../MOM6-examples/symmetric_gnu.tar && md5sum -c all_gnu.md5 && rm all_gnu.md5
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- time tar zxf $CACHE_DIR/results-$CI_PIPELINE_ID.tgz
- make -f MRS/Makefile.tests gnu_symmetric

intel:symmetric:
stage: tests
tags:
- ncrc3
script:
- mkdir -p _intel && cd _intel
- tar xf ../MOM6-examples/non_symmetric_intel.tar && md5sum `find . -name ocean.stats.intel` > all_intel.md5 && find . -name ocean.stats.intel -exec rm {} \;
- echo "Regression results for symmetric executables"
- tar xf ../MOM6-examples/symmetric_intel.tar && md5sum -c all_intel.md5 && rm all_intel.md5
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- time tar zxf $CACHE_DIR/results-$CI_PIPELINE_ID.tgz
- make -f MRS/Makefile.tests intel_symmetric

pgi:symmetric:
stage: tests
tags:
- ncrc3
script:
- mkdir -p _pgi && cd _pgi
- tar xf ../MOM6-examples/non_symmetric_pgi.tar && md5sum `find . -name ocean.stats.pgi` > all_pgi.md5 && find . -name ocean.stats.pgi -exec rm {} \;
- echo "Regression results for symmetric executables"
- tar xf ../MOM6-examples/symmetric_pgi.tar && md5sum -c all_pgi.md5 && rm all_pgi.md5
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- time tar zxf $CACHE_DIR/results-$CI_PIPELINE_ID.tgz
- make -f MRS/Makefile.tests pgi_symmetric

gnu:layout:
stage: tests
tags:
- ncrc3
script:
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- time tar zxf $CACHE_DIR/results-$CI_PIPELINE_ID.tgz
- make -f MRS/Makefile.tests gnu_layout

intel:layout:
stage: tests
tags:
- ncrc3
script:
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- time tar zxf $CACHE_DIR/results-$CI_PIPELINE_ID.tgz
- make -f MRS/Makefile.tests intel_layout

pgi:layout:
stage: tests
tags:
- ncrc3
script:
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- time tar zxf $CACHE_DIR/results-$CI_PIPELINE_ID.tgz
- make -f MRS/Makefile.tests pgi_layout

gnu:static:
stage: tests
tags:
- ncrc3
script:
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- time tar zxf $CACHE_DIR/results-$CI_PIPELINE_ID.tgz
- make -f MRS/Makefile.tests gnu_static

gnu:restart:
stage: tests
tags:
- ncrc3
script:
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- time tar zxf $CACHE_DIR/results-$CI_PIPELINE_ID.tgz
- make -f MRS/Makefile.tests gnu_check_restarts

cleanup:
stage: cleanup
tags:
- ncrc3
script:
- rm $CACHE_DIR/*$CI_PIPELINE_ID.tgz
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ addons:
cache:
directories:
- MOM6-examples
- build
# - build # Uncomment this line to save time building. Less robust when FMS changes version!

# Install tools and clone the configurations repository
before_install:
Expand Down
42 changes: 23 additions & 19 deletions config_src/coupled_driver/MOM_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,15 @@ module MOM_surface_forcing
use MOM_string_functions, only : uppercase
use MOM_spatial_means, only : adjust_area_mean_to_zero
use MOM_variables, only : surface
use user_revise_forcing, only : user_alter_forcing, user_revise_forcing_init, user_revise_forcing_CS

use coupler_types_mod, only : coupler_2d_bc_type
use data_override_mod, only : data_override_init, data_override
use fms_mod, only : read_data, stdout
use mpp_mod, only : mpp_chksum
use user_revise_forcing, only : user_alter_forcing, user_revise_forcing_init
use user_revise_forcing, only : user_revise_forcing_CS

use coupler_types_mod, only : coupler_2d_bc_type, coupler_type_write_chksums
use coupler_types_mod, only : coupler_type_initialized, coupler_type_spawn
use coupler_types_mod, only : coupler_type_copy_data
use data_override_mod, only : data_override_init, data_override
use fms_mod, only : read_data, stdout
use mpp_mod, only : mpp_chksum
use time_interp_external_mod, only : init_external_field, time_interp_external
use time_interp_external_mod, only : time_interp_external_init

Expand Down Expand Up @@ -356,6 +359,15 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, G, CS, state,
fluxes%dt_buoy_accum = 0.0
endif ! endif for allocation and initialization

if ((.not.coupler_type_initialized(fluxes%tr_fluxes)) .and. &
coupler_type_initialized(IOB%fluxes)) &
call coupler_type_spawn(IOB%fluxes, fluxes%tr_fluxes, &
(/is,is,ie,ie/), (/js,js,je,je/))
! It might prove valuable to use the same array extents as the rest of the
! ocean model, rather than using haloless arrays, in which case the last line
! would be: ( (/isd,is,ie,ied/), (/jsd,js,je,jed/))


if (CS%allow_flux_adjustments) then
fluxes%heat_added(:,:)=0.0
fluxes%salt_flux_added(:,:)=0.0
Expand Down Expand Up @@ -729,10 +741,9 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, G, CS, state,
enddo ; enddo
endif

! At a later time, it might prove valuable to translate this array into the
! index space of the ocean model, rather than leaving it in the (haloless)
! arrays that come in from the surface forcing.
fluxes%tr_fluxes => IOB%fluxes
if (coupler_type_initialized(fluxes%tr_fluxes) .and. &
coupler_type_initialized(IOB%fluxes)) &
call coupler_type_copy_data(IOB%fluxes, fluxes%tr_fluxes)

if (CS%allow_flux_adjustments) then
! Apply adjustments to fluxes
Expand Down Expand Up @@ -1227,16 +1238,9 @@ subroutine ice_ocn_bnd_type_chksum(id, timestep, iobt)
write(outunit,100) 'iobt%area_berg ', mpp_chksum( iobt%area_berg )
if (ASSOCIATED(iobt%mass_berg)) &
write(outunit,100) 'iobt%mass_berg ', mpp_chksum( iobt%mass_berg )

100 FORMAT(" CHECKSUM::",A20," = ",Z20)
do n = 1, iobt%fluxes%num_bcs !{
do m = 1, iobt%fluxes%bc(n)%num_fields !{
write(outunit,101) 'iobt%',trim(iobt%fluxes%bc(n)%name), &
trim(iobt%fluxes%bc(n)%field(m)%name), &
mpp_chksum(iobt%fluxes%bc(n)%field(m)%values)
enddo !} m
enddo !} n
101 FORMAT(" CHECKSUM::",A6,a,'%',a," = ",Z20)

call coupler_type_write_chksums(iobt%fluxes, outunit, 'iobt%')

end subroutine ice_ocn_bnd_type_chksum

Expand Down
Loading

0 comments on commit da77242

Please sign in to comment.