Skip to content

Commit

Permalink
Merge pull request ESCOMP#333 from jedwards4b/add_werror_to_github_tests
Browse files Browse the repository at this point in the history
add werror to extbuild
### Description of changes
Add werror to github testing - no gfortran warnings allowed.

### Specific notes

Contributors other than yourself, if any:

CMEPS Issues Fixed (include github issue #):

Are changes expected to change answers? (specify if bfb, different at roundoff, more substantial) 
BFB
Any User Interface Changes (namelist or namelist defaults changes)? NO

### Testing performed

Testing performed if application target is CESM:
- [ ] (recommended) CIME_DRIVER=nuopc scripts_regression_tests.py
   - machines:
   - details (e.g. failed tests):
- [ ] (recommended) CESM testlist_drv.xml
   - machines and compilers:
   - details (e.g. failed tests):
- [X] (optional) CESM prealpha test
   - machines and compilers   cheyenne, intel, gnu, github testing.
   - details (e.g. failed tests):
- [ ] (other) please described in detail
   - machines and compilers
   - details (e.g. failed tests):

Testing performed if application target is UFS-coupled:
- [ ] (recommended) UFS-coupled testing
   - description:
   - details (e.g. failed tests):

Testing performed if application target is UFS-HAFS:
- [ ] (recommended) UFS-HAFS testing
   - description:
   - details (e.g. failed tests):

### Hashes used for testing:

- [X] CESM:
  - repository to check out: https://github.com/ESCOMP/CESM.git
  - branch/hash: cesm2_3_beta11
- [ ] UFS-coupled, then umbrella repostiory to check out and associated hash:
  - repository to check out:
  - branch/hash:
- [ ] UFS-HAFS, then umbrella repostiory to check out and associated hash:
  - repository to check out:
  - branch/hash:
  • Loading branch information
jedwards4b authored Jan 9, 2023
2 parents 39b2b11 + d81f8d0 commit 6d4c1ff
Show file tree
Hide file tree
Showing 43 changed files with 181 additions and 376 deletions.
49 changes: 13 additions & 36 deletions .github/workflows/extbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,53 +30,30 @@ jobs:
- id: load-env
run: |
sudo apt-get update
sudo apt-get install gfortran wget openmpi-bin netcdf-bin libopenmpi-dev libnetcdf-dev autotools-dev autoconf
sudo apt-get update
sudo apt-get install gfortran
sudo apt-get install wget
sudo apt-get install openmpi-bin libopenmpi-dev
sudo apt-get install netcdf-bin libnetcdf-dev libnetcdff-dev
sudo apt-get install pnetcdf-bin libpnetcdf-dev
sudo apt-get install autotools-dev autoconf
- id: cache-esmf
uses: actions/cache@v3
with:
path: ~/ESMF
key: ${{ runner.os }}-${{ env.ESMF_VERSION }}-ESMF
- id: cache-pnetcdf
uses: actions/cache@v2
with:
path: ~/pnetcdf
key: ${{ runner.os }}-${{ env.PNETCDF_VERSION}}-pnetcdf
- name: Cache netcdf-fortran
id: cache-netcdf-fortran
uses: actions/cache@v2
with:
path: ~/netcdf-fortran
key: ${{ runner.os }}-${{ env.NETCDF_FORTRAN_VERSION }}-netcdf-fortran
- name: Cache ParallelIO
id: cache-ParallelIO
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/pio
key: ${{ runner.os }}-${{ env.PIO_VERSION }}.pio
restore-keys: |
${{ runner.os }}-${{ env.NETCDF_FORTRAN_VERSION }}-netcdf-fortran
${{ runner.os }}-${{ env.PNETCDF_VERSION }}-pnetcdf
- name: Build PNetCDF
if: steps.cache-pnetcdf.outputs.cache-hit != 'true'
uses: ESCOMP/CDEPS/.github/actions/buildpnetcdf@e06246b560d3132170bb1a5443fa3d65dfbd2040
with:
pnetcdf_version: ${{ env.PNETCDF_VERSION }}
install_prefix: $HOME/pnetcdf
- name: Build NetCDF Fortran
if: steps.cache-netcdf-fortran.outputs.cache-hit != 'true'
uses: ESCOMP/CDEPS/.github/actions/buildnetcdff@e06246b560d3132170bb1a5443fa3d65dfbd2040
with:
netcdf_fortran_version: ${{ env.NETCDF_FORTRAN_VERSION }}
install_prefix: $HOME/netcdf-fortran
netcdf_c_path: /usr
- name: Build ParallelIO
if: steps.cache-ParallelIO.outputs.cache-hit != 'true'
uses: ESCOMP/CDEPS/.github/actions/buildpio@e06246b560d3132170bb1a5443fa3d65dfbd2040
uses: NCAR/ParallelIO/.github/actions/parallelio_cmake@9390e30e29d4ebbfbef0fc72162cacd9e8f25e4e
with:
parallelio_version: ${{ env.ParallelIO_VERSION }}
netcdf_c_path: /usr
netcdf_fortran_path: $HOME/netcdf-fortran
pnetcdf_path: $HOME/pnetcdf
enable_fortran: True
install_prefix: $HOME/pio
- name: Build ESMF
if: steps.cache-esmf.outputs.cache-hit != 'true'
Expand All @@ -87,15 +64,15 @@ jobs:
esmf_comm: openmpi
install_prefix: $HOME/ESMF
netcdf_c_path: /usr
netcdf_fortran_path: $HOME/netcdf-fortran
pnetcdf_path: $HOME/pnetcdf
netcdf_fortran_path: /usr
pnetcdf_path: /usr
parallelio_path: $HOME/pio
- name: Build CMEPS
run: |
export ESMFMKFILE=$HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk
export PIO=$HOME/pio
mkdir build-cmeps
pushd build-cmeps
cmake -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_Fortran_FLAGS="-g -Wall -ffree-form -ffree-line-length-none" ../
cmake -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_Fortran_FLAGS="-g -Wall -Werror -ffree-form -ffree-line-length-none -Wno-unused-dummy-argument" ../
make VERBOSE=1
popd
7 changes: 2 additions & 5 deletions cesm/driver/ensemble_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,12 @@ subroutine SetModelServices(ensemble_driver, rc)
type(ESMF_VM) :: vm
type(ESMF_GridComp) :: driver, gridcomptmp
type(ESMF_Config) :: config
integer :: n, n1, stat
integer :: n
integer, pointer :: petList(:)
character(len=20) :: model, prefix
integer :: petCount, i
integer :: petCount
integer :: localPet
logical :: is_set
character(len=512) :: diro
character(len=512) :: logfile
integer :: global_comm
logical :: read_restart
character(len=CS) :: read_restart_string
integer :: inst
Expand Down
42 changes: 14 additions & 28 deletions cesm/driver/esm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ subroutine SetServices(driver, rc)
integer, intent(out) :: rc

! local variables
type(ESMF_Config) :: runSeq
character(len=*), parameter :: subname = "(esm.F90:SetServices)"
!---------------------------------------

Expand Down Expand Up @@ -125,9 +124,7 @@ subroutine SetModelServices(driver, rc)
! local variables
type(ESMF_VM) :: vm
type(ESMF_Config) :: config
integer :: n, i, stat
character(len=20) :: model, prefix
integer :: localPet, medpet
integer :: localPet
character(len=CL) :: meminitStr
integer :: global_comm
integer :: maxthreads
Expand Down Expand Up @@ -241,7 +238,6 @@ subroutine SetRunSequence(driver, rc)
integer, intent(out) :: rc

! local variables
integer :: localrc
type(ESMF_Config) :: runSeq
type(NUOPC_FreeFormat) :: runSeqFF
character(len=*), parameter :: subname = "(esm.F90:SetRunSequence)"
Expand All @@ -267,17 +263,17 @@ subroutine SetRunSequence(driver, rc)

call NUOPC_DriverIngestRunSequence(driver, runSeqFF, autoAddConnectors=.true., rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

#ifdef DEBUG
! Uncomment these to add debugging information for driver
! call NUOPC_DriverPrint(driver, orderflag=.true.)
! if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
! line=__LINE__, &
! file=__FILE__)) &
! return ! bail out

! call pretty_print_nuopc_freeformat(runSeqFF, 'run sequence', rc=rc)
! if (chkerr(rc,__LINE__,u_FILE_u)) return

! call pretty_print_nuopc_freeformat(runSeqFF, 'run sequence', rc=rc)
! if (chkerr(rc,__LINE__,u_FILE_u)) return
#endif
call NUOPC_FreeFormatDestroy(runSeqFF, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

Expand Down Expand Up @@ -433,11 +429,7 @@ subroutine InitAttributes(driver, rc)
type(ShrWVSatTableSpec) :: liquid_spec
type(ShrWVSatTableSpec) :: ice_spec
type(ShrWVSatTableSpec) :: mixed_spec
logical :: flag
integer :: i, it, n
integer :: unitn ! Namelist unit number to read
integer :: localPet, rootpe_med
character(len=CL) :: msgstr
integer , parameter :: ens1=1 ! use first instance of ensemble only
integer , parameter :: fix1=1 ! temporary hard-coding to first ensemble, needs to be fixed
real(R8) , parameter :: epsilo = shr_const_mwwv/shr_const_mwdair
Expand Down Expand Up @@ -568,8 +560,6 @@ subroutine CheckAttributes( driver, rc )
integer , intent(out) :: rc

!----- local -----
character(len=CL) :: cvalue ! temporary
character(len=CL) :: start_type ! Type of startup
character(len=CS) :: logFilePostFix ! postfix for output log files
character(len=CL) :: outPathRoot ! root for output log files
character(len=CS) :: cime_model
Expand Down Expand Up @@ -627,12 +617,9 @@ subroutine AddAttributes(gcomp, driver, config, compid, compname, inst_suffix, n
integer , intent(inout) :: rc

! local variables
integer :: n
integer :: stat
integer :: inst_index
character(len=CL) :: cvalue
character(len=CS) :: attribute
integer :: componentCount
character(len=*), parameter :: subname = "(esm.F90:AddAttributes)"
!-------------------------------------------

Expand Down Expand Up @@ -750,12 +737,12 @@ subroutine ReadAttributes(gcomp, config, label, relaxedflag, formatprint, rc)

call NUOPC_CompAttributeIngest(gcomp, attrFF, addFlag=.true., rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

! if (present (formatprint)) then
! call pretty_print_nuopc_freeformat(attrFF, trim(label)//' attributes', rc=rc)
! if (chkerr(rc,__LINE__,u_FILE_u)) return
! end if

#ifdef DEBUG
! if (present (formatprint)) then
! call pretty_print_nuopc_freeformat(attrFF, trim(label)//' attributes', rc=rc)
! if (chkerr(rc,__LINE__,u_FILE_u)) return
! end if
#endif
call NUOPC_FreeFormatDestroy(attrFF, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

Expand Down Expand Up @@ -870,11 +857,10 @@ subroutine esm_init_pelayout(driver, maxthreads, rc)
type(ESMF_VM) :: vm
type(ESMF_Config) :: config
type(ESMF_Info) :: info
integer :: componentcount
integer :: PetCount
integer :: LocalPet
integer :: ComponentCount
integer :: ntasks, rootpe, nthrds, stride
integer :: ntask, cnt
integer :: ntask
integer :: i
integer :: stat
character(len=32), allocatable :: compLabels(:)
Expand Down Expand Up @@ -1254,7 +1240,7 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
!-------------------------------------------------------------------------------

rc = ESMF_SUCCESS

scol_mesh_n = 0
! obtain the single column lon and lat
call NUOPC_CompAttributeGet(gcomp, name='scol_lon', value=cvalue, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
Expand Down
12 changes: 5 additions & 7 deletions cesm/driver/esm_time_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module esm_time_mod

public :: esm_time_clockInit ! initialize driver clock (assumes default calendar)

private :: esm_time_timeInit
! private :: esm_time_timeInit
private :: esm_time_alarmInit
private :: esm_time_date2ymd

Expand Down Expand Up @@ -87,15 +87,14 @@ subroutine esm_time_clockInit(ensemble_driver, instance_driver, logunit, mastert
integer :: glc_cpl_dt ! Glc coupling interval
integer :: rof_cpl_dt ! Runoff coupling interval
integer :: wav_cpl_dt ! Wav coupling interval
integer :: esp_cpl_dt ! Esp coupling interval
! integer :: esp_cpl_dt ! Esp coupling interval
character(CS) :: glc_avg_period ! Glc avering coupling period
logical :: read_restart
character(len=CL) :: restart_file
character(len=CL) :: restart_pfile
character(len=CL) :: cvalue
integer :: dtime_drv ! time-step to use
integer :: yr, mon, day, sec ! Year, month, day, secs as integers
integer :: localPet ! local pet in esm domain
integer :: yr, mon, day ! Year, month, day as integers
integer :: unitn ! unit number
integer :: ierr ! Return code
character(CL) :: tmpstr ! temporary
Expand Down Expand Up @@ -392,7 +391,6 @@ subroutine esm_time_alarmInit( clock, alarm, option, &
type(ESMF_Time) :: CurrTime ! Current Time
type(ESMF_Time) :: NextAlarm ! Next restart alarm time
type(ESMF_TimeInterval) :: AlarmInterval ! Alarm interval
integer :: sec
character(len=*), parameter :: subname = '(med_time_alarmInit): '
!-------------------------------------------------------------------------------

Expand Down Expand Up @@ -563,7 +561,7 @@ subroutine esm_time_alarmInit( clock, alarm, option, &
end subroutine esm_time_alarmInit

!===============================================================================

#ifdef UNUSEDFUNCTION
subroutine esm_time_timeInit( Time, ymd, cal, tod, desc, logunit )

! Create the ESMF_Time object corresponding to the given input time, given in
Expand Down Expand Up @@ -607,7 +605,7 @@ subroutine esm_time_timeInit( Time, ymd, cal, tod, desc, logunit )
if (ChkErr(rc,__LINE__,u_FILE_u)) return

end subroutine esm_time_timeInit

#endif
!===============================================================================

subroutine esm_time_date2ymd (date, year, month, day)
Expand Down
1 change: 0 additions & 1 deletion cesm/driver/t_driver_timers_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ subroutine t_drvstopf(string,cplrun,cplcom,budget,hashint)
logical,intent(in),optional :: cplcom
logical,intent(in),optional :: budget
integer, intent(in), optional :: hashint
character(len=128) :: strbar
logical :: lcplrun,lcplcom,lbudget

!-------------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion cesm/flux_atmocn/shr_flux_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,8 @@ SUBROUTINE flux_atmOcn_diurnal &
tSkin_night(:) = ts(:)
cSkin_night(:) = 0.0_R8
endif

u10n = 0.0_r8
stable = 0.0_r8
DO n=1,nMax

if (mask(n) /= 0) then
Expand Down
2 changes: 1 addition & 1 deletion cime_config/namelist_definition_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@
default: xgrid
</desc>
<values>
<value>xgrid</value>
<value>ogrid</value>
</values>
</entry>
<entry id="ocn_surface_flux_scheme">
Expand Down
4 changes: 2 additions & 2 deletions mediator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ set(SRCFILES esmFldsExchange_cesm_mod.F90 med_fraction_mod.F90
esmFldsExchange_nems_mod.F90 med_io_mod.F90
med_phases_history_mod.F90 med_phases_prep_ocn_mod.F90
med_utils_mod.F90 esmFlds.F90 med_kind_mod.F90
med_phases_ocnalb_mod.F90 med_phases_prep_rof_mod.F90
med_phases_prep_rof_mod.F90
med_constants_mod.F90 med_map_mod.F90
med_phases_prep_atm_mod.F90 med_phases_prep_wav_mod.F90
med.F90 med_merge_mod.F90 med_phases_prep_glc_mod.F90
med_phases_profile_mod.F90 med_diag_mod.F90
med_phases_post_ocn_mod.F90
med_phases_post_ocn_mod.F90 med_phases_ocnalb_mod.F90
med_phases_post_atm_mod.F90 med_phases_post_ice_mod.F90
med_phases_post_lnd_mod.F90 med_phases_post_glc_mod.F90
med_phases_post_rof_mod.F90 med_phases_post_wav_mod.F90)
Expand Down
17 changes: 3 additions & 14 deletions mediator/esmFlds.F90
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ subroutine med_fldList_AddMap(fields, fldname, destcomp, maptype, mapnorm, mapfi

! local variables
type(med_fldList_entry_type), pointer :: newfld
integer :: id, n, rc
integer :: rc
character(len=CX) :: lmapfile
character(len=*),parameter :: subname='(med_fldList_AddMap)'
! ----------------------------------------------
Expand Down Expand Up @@ -458,7 +458,6 @@ subroutine med_fldList_Realize(state, fldList, flds_scalar_name, flds_scalar_num
integer :: n
type(ESMF_Field) :: field
character(CS) :: shortname
character(CS) :: stdname
character(ESMF_MAXSTR) :: transferActionAttr
type(ESMF_StateIntent_Flag) :: stateIntent
character(ESMF_MAXSTR) :: transferAction
Expand Down Expand Up @@ -817,20 +816,12 @@ subroutine med_fldList_Document_Mapping(logunit, med_coupling_active)
logical, intent(in) :: med_coupling_active(:,:)

! local variables
integer :: nsrc,ndst,nf,nm,n
integer :: nsrc,ndst
integer :: mapindex
character(len=CS) :: mapnorm
character(len=CL) :: mapfile
character(len=CS) :: fldname
character(len=CS) :: stdname
character(len=CX) :: merge_fields
character(len=CX) :: merge_field
character(len=CS) :: merge_type
character(len=CS) :: merge_fracname
character(len=CS) :: string
character(len=CL) :: mrgstr
character(len=CL) :: cvalue
logical :: init_mrgstr
type(med_fldList_entry_type), pointer :: newfld
character(len=*),parameter :: subname = '(med_fldList_Document_Mapping)'
!-----------------------------------------------------------
Expand Down Expand Up @@ -919,18 +910,16 @@ subroutine med_fldList_Document_Merging(logunit, med_coupling_active)
logical, intent(in) :: med_coupling_active(:,:)

! local variables
integer :: nsrc,ndst,nf,n
integer :: nsrc,ndst
character(len=CS) :: dst_comp
character(len=CS) :: dst_field
character(len=CS) :: src_comp
character(len=CS) :: src_field
character(len=CS) :: merge_type
character(len=CS) :: merge_field
character(len=CS) :: merge_frac
character(len=CS) :: prefix
character(len=CS) :: string
character(len=CL) :: mrgstr
logical :: init_mrgstr
type(med_fldList_entry_type), pointer :: newfld
character(len=*),parameter :: subname = '(med_fldList_Document_Merging)'
!-----------------------------------------------------------
Expand Down
2 changes: 0 additions & 2 deletions mediator/esmFldsExchange_cesm_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
use med_internalstate_mod , only : compice, comprof, compwav, compglc, ncomps
use med_internalstate_mod , only : mapbilnr, mapconsf, mapconsd, mappatch, mappatch_uv3d, mapbilnr_nstod
use med_internalstate_mod , only : mapfcopy, mapnstod, mapnstod_consd, mapnstod_consf
use med_internalstate_mod , only : coupling_mode
use med_internalstate_mod , only : map_glc2ocn_ice, map_glc2ocn_liq, map_rof2ocn_ice, map_rof2ocn_liq
use esmFlds , only : addfld_ocnalb => med_fldList_addfld_ocnalb
use esmFlds , only : addfld_aoflux => med_fldList_addfld_aoflux
Expand All @@ -97,7 +96,6 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
type(InternalState) :: is_local
integer :: n, ns
character(len=CL) :: cvalue
character(len=CS) :: name
logical :: wavice_coupling
logical :: ocn2glc_coupling
character(len=*) , parameter :: subname=' (esmFldsExchange_cesm) '
Expand Down
Loading

0 comments on commit 6d4c1ff

Please sign in to comment.