Skip to content

Commit

Permalink
Merge branch 'release-v6.0'
Browse files Browse the repository at this point in the history
This merge introduces v6.0 of all MPAS models.

* release-v6.0: (2051 commits)
  Reimplement C++ support in ESM Makefiles
  Minor edits to Steve's Registry updates
  Updates/corrections to Registry descriptions and units
  Minor edits to formatting in registry
  Change '%i' to '$i' in call to mpas_log_write from mpas_block_decomp_cells_for_proc
  Edits to variable descriptions in Registry files
  More updates to Registry file descriptions
  Updates to Registry descriptions
  Change default for config_nvertlevels from 41 to 55 for MPAS-Atmosphere
  Fix incorrect size of 'hlanduse' array in GWDO field computation
  Reorganizes Registry.xml for ocean users guide
  Updates to Registry to get User's Guide to build
  Update version number to 6.0
  Remove mpas_threading.o dependency on mpas_log.o
  Compute initial w field in bit-reproducible way
  Remove exner_base, pressure_base from IC file, compute these during start up
  Remove 'soilcat_bot' field from init_atmosphere core
  Minimize the size of atmosphere IC files with no change to model results
  Change time series stats restart name format
  Change time series stats output name format
  ...
  • Loading branch information
matthewhoffman committed Apr 17, 2018
2 parents 7221fbd + 105aa0a commit ece5f71
Show file tree
Hide file tree
Showing 1,427 changed files with 249,738 additions and 17,239 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MPAS-v5.3
MPAS-v6.0
====

The Model for Prediction Across Scales (MPAS) is a collaborative project for
Expand Down
12 changes: 6 additions & 6 deletions src/Makefile.in.ACME
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ else
endif
# End duplicated logic

include $(CASEROOT)/Macros
include $(CASEROOT)/Macros.make

ifneq ($(wildcard core_$(CORE)/build_options.mk), ) # Check for build_options.mk
include core_$(CORE)/build_options.mk
Expand All @@ -27,7 +27,7 @@ ifeq "$(CORE)" "ocean"
COMPONENT=ocn
else ifeq "$(CORE)" "landice"
COMPONENT=glc
else ifeq "$(CORE)" "cice"
else ifeq "$(CORE)" "seaice"
COMPONENT=ice
endif

Expand All @@ -44,14 +44,14 @@ CC=$(MPICC)
CXX=$(MPICXX)
NETCDF=$(NETCDF_PATH)
PNETCDF=$(PNETCDF_PATH)
PIO=$(EXEROOT)/pio
PIO=$(INSTALL_SHAREDPATH)/pio
FILE_OFFSET = -DOFFSET64BIT
override CFLAGS += -DMPAS_NO_LOG_REDIRECT -DMPAS_NO_ESMF_INIT -DMPAS_ESM_SHR_CONST -DMPAS_PERF_MOD_TIMERS
override FFLAGS += -DMPAS_NO_LOG_REDIRECT -DMPAS_NO_ESMF_INIT -DMPAS_ESM_SHR_CONST -DMPAS_PERF_MOD_TIMERS
override CPPFLAGS += $(CPPDEFS) $(MODEL_FORMULATION) $(FILE_OFFSET) $(ZOLTAN_DEFINE) -DMPAS_NO_LOG_REDIRECT -DMPAS_NO_ESMF_INIT -DMPAS_ESM_SHR_CONST -D_MPI -DMPAS_NAMELIST_SUFFIX=$(NAMELIST_SUFFIX) -DMPAS_EXE_NAME=$(EXE_NAME) -DMPAS_PERF_MOD_TIMERS
override CPPINCLUDES += -I$(EXEROOT)/$(COMPONENT)/source/inc -I$(SHAREDPATH)/include -I$(SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/$(NINST_VALUE)/csm_share -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
override FCINCLUDES += -I$(EXEROOT)/$(COMPONENT)/source/inc -I$(SHAREDPATH)/include -I$(SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/$(NINST_VALUE)/csm_share -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
LIBS += -L$(PIO) -L$(PNETCDF)/lib -L$(NETCDF)/lib -L$(LIBROOT) -L$(SHAREDPATH)/lib -lpio -lpnetcdf -lnetcdf
override CPPINCLUDES += -I$(EXEROOT)/$(COMPONENT)/source/inc -I$(INSTALL_SHAREDPATH)/include -I$(INSTALL_SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/$(NINST_VALUE)/csm_share -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
override FCINCLUDES += -I$(EXEROOT)/$(COMPONENT)/source/inc -I$(INSTALL_SHAREDPATH)/include -I$(INSTALL_SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/$(NINST_VALUE)/csm_share -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
LIBS += -L$(PIO) -L$(PNETCDF)/lib -L$(NETCDF)/lib -L$(LIBROOT) -L$(INSTALL_SHAREDPATH)/lib -lpio -lpnetcdf -lnetcdf

ifneq (,$(findstring FORTRANUNDERSCORE, $(CPPFLAGS)))
ifeq (,$(findstring DUNDERSCORE, $(CPPFLAGS)))
Expand Down
4 changes: 2 additions & 2 deletions src/Makefile.in.CESM
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ else
endif
# End duplicated logic

include $(CASEROOT)/Macros
include $(CASEROOT)/Macros.make

ifneq ($(wildcard core_$(CORE)/build_options.mk), ) # Check for build_options.mk
include core_$(CORE)/build_options.mk
Expand All @@ -27,7 +27,7 @@ ifeq "$(CORE)" "ocean"
COMPONENT=ocn
else ifeq "$(CORE)" "landice"
COMPONENT=glc
else ifeq "$(CORE)" "cice"
else ifeq "$(CORE)" "seaice"
COMPONENT=ice
endif

Expand Down
4 changes: 2 additions & 2 deletions src/core_atmosphere/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ physcore: mpas_atm_dimensions.o
( cd ../..; ln -sf ./src/core_atmosphere/physics/physics_wrf/files/*TBL .)
( cd ../..; ln -sf ./src/core_atmosphere/physics/physics_wrf/files/*DATA* .)

dycore: mpas_atm_dimensions.o
dycore: mpas_atm_dimensions.o physcore
( cd dynamics; $(MAKE) all PHYSICS="$(PHYSICS)" )

diagcore: physcore dycore
Expand All @@ -48,7 +48,7 @@ atmcore: physcore dycore diagcore $(OBJS)

mpas_atm_core_interface.o: mpas_atm_core.o

mpas_atm_core.o: dycore mpas_atm_threading.o
mpas_atm_core.o: dycore diagcore mpas_atm_threading.o

mpas_atm_dimensions.o:

Expand Down
24 changes: 14 additions & 10 deletions src/core_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="atmosphere" core_abbrev="atm" version="5.3">
<registry model="mpas" core="atmosphere" core_abbrev="atm" version="6.0">

<!-- **************************************************************************************** -->
<!-- ************************************** Dimensions ************************************** -->
Expand Down Expand Up @@ -429,14 +429,13 @@
<var name="defc_b"/>
<var name="coeffs_reconstruct"/>
<var_array name="scalars"/>
<var name="initial_time"/>
<var name="xtime"/>
<var name="u"/>
<var name="w"/>
<var name="rho"/>
<var name="theta"/>
<var name="relhum"/>
<var name="exner_base"/>
<var name="pressure_base"/>
<var name="rho_base"/>
<var name="theta_base"/>
<var name="surface_pressure"/>
Expand Down Expand Up @@ -563,6 +562,7 @@
<var name="re_snow" packages="mp_thompson_in;mp_wsm6_in"/>
<var name="nt_c" packages="mp_thompson_in"/>
<var name="mu_c" packages="mp_thompson_in"/>
<var name="initial_time"/>
<var name="xtime"/>
<var name="u"/>
<var name="w"/>
Expand Down Expand Up @@ -845,6 +845,7 @@
<var name="fzm"/>
<var name="fzp"/>
<var name="zz"/>
<var name="initial_time"/>
<var name="xtime"/>
<var name="u"/>
<var name="w"/>
Expand Down Expand Up @@ -924,6 +925,7 @@
output_interval="3:00:00"
runtime_format="separate_file">

<var name="initial_time"/>
<var name="xtime"/>
<var name="olrtoa"/>
<var name="rainc"/>
Expand Down Expand Up @@ -1299,14 +1301,13 @@

<var name="north" type="real" dimensions="R3 nCells" units="unitless"
description="Cartesian components of the unit vector pointing north"/>

<!-- Arrays needed only in the CAM LW and SW radiation codes: Aerosols -->
<var name="m_hybi" type="real" dimensions="nAerLevels nCells" units="unitless"
description="Matched hybi (needs to be re-checked)"/>
</var_struct>

<var_struct name="state" time_levs="2">

<var name="initial_time" type="text" dimensions="" units="YYYY-MM-DD_hh:mm:ss"
description="Model initialization time"/>

<var name="xtime" type="text" dimensions="Time" units="YYYY-MM-DD_hh:mm:ss"
description="Model valid time"/>

Expand All @@ -1323,9 +1324,6 @@
<var name="theta_m" type="real" dimensions="nVertLevels nCells Time" units="K"
description="Moist potential temperature: theta*(1+q_v*R_v/R_d)"/>

<var name="m_ps" type="real" dimensions="nCells Time" units="Pa"
description="Surface pressure from match on MPAS grid"/>

<var_array name="scalars" type="real" dimensions="nVertLevels nCells Time">
<var name="qv" array_group="moist" units="kg kg^{-1}"
description="Water vapor mixing ratio"/>
Expand Down Expand Up @@ -2547,6 +2545,12 @@
<!-- ... ADDITIONAL "RADIATION" ARRAYS NEEDED ONLY IN THE "CAM" LW AND SW RADIATION CODES: -->
<!-- ================================================================================================== -->

<var name="m_hybi" type="real" dimensions="nAerLevels nCells" units="unitless"
description="Matched hybi (needs to be re-checked)"/>

<var name="m_ps" type="real" dimensions="nCells Time" units="Pa"
description="Surface pressure from match on MPAS grid"/>

<!-- INFRARED ABSORPTION: -->
<var name="absnxt" type="real" dimensions="nVertLevels cam_dim1 nCells Time" units="-"
description="Total nearest layer absorptivity"/>
Expand Down
82 changes: 40 additions & 42 deletions src/core_atmosphere/diagnostics/convective_diagnostics.F
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
!
module convective_diagnostics

use mpas_derived_types, only : MPAS_pool_type, MPAS_clock_type
use mpas_derived_types, only : MPAS_pool_type, MPAS_clock_type, MPAS_LOG_ERR, MPAS_LOG_CRIT
use mpas_kind_types, only : RKIND
use mpas_log, only : mpas_log_write

type (MPAS_pool_type), pointer :: mesh
type (MPAS_pool_type), pointer :: state
Expand Down Expand Up @@ -748,7 +749,7 @@ subroutine getcape( nk , p_in , t_in , td_in, cape , cin )
endif
enddo
ENDIF
if(debug_level.ge.100) print *,' kmax,maxthe = ',kmax,maxthe
if(debug_level.ge.100) call mpas_log_write(' kmax,maxthe = $i $r', intArgs=(/kmax/), realArgs=(/maxthe/))

ELSEIF(source.eq.3)THEN
! use mixed layer
Expand All @@ -775,13 +776,12 @@ subroutine getcape( nk , p_in , t_in , td_in, cape , cin )
avgth = 0.0
avgqv = 0.0
k = 2
if(debug_level.ge.100) print *,' ml_depth = ',ml_depth
if(debug_level.ge.100) print *,' k,z,th,q:'
if(debug_level.ge.100) print *,1,z(1),th(1),q(1)
if(debug_level.ge.100) call mpas_log_write(' ml_depth = $r', realArgs=(/ml_depth/))
if(debug_level.ge.100) call mpas_log_write(' k,z,th,q: $i $r $r $r', intArgs=(/1/), realArgs=(/z(1),th(1),q(1)/))

do while( (z(k).le.ml_depth) .and. (k.le.nk) )

if(debug_level.ge.100) print *,k,z(k),th(k),q(k)
if(debug_level.ge.100) call mpas_log_write('$i $r $r $r', intArgs=(/k/), realArgs=(/z(k),th(k),q(k)/))

avgth = avgth + 0.5*(z(k)-z(k-1))*(th(k)+th(k-1))
avgqv = avgqv + 0.5*(z(k)-z(k-1))*(q(k)+q(k-1))
Expand All @@ -793,12 +793,12 @@ subroutine getcape( nk , p_in , t_in , td_in, cape , cin )
th2 = th(k-1)+(th(k)-th(k-1))*(ml_depth-z(k-1))/(z(k)-z(k-1))
qv2 = q(k-1)+( q(k)- q(k-1))*(ml_depth-z(k-1))/(z(k)-z(k-1))

if(debug_level.ge.100) print *,999,ml_depth,th2,qv2
if(debug_level.ge.100) call mpas_log_write('999 $r $r $r', realArgs=(/ml_depth,th2,qv2/))

avgth = avgth + 0.5*(ml_depth-z(k-1))*(th2+th(k-1))
avgqv = avgqv + 0.5*(ml_depth-z(k-1))*(qv2+q(k-1))

if(debug_level.ge.100) print *,k,z(k),th(k),q(k)
if(debug_level.ge.100) call mpas_log_write('$i $r $r $r', intArgs=(/k/), realArgs=(/z(k),th(k),q(k)/))

avgth = avgth/ml_depth
avgqv = avgqv/ml_depth
Expand All @@ -807,17 +807,16 @@ subroutine getcape( nk , p_in , t_in , td_in, cape , cin )

ENDIF

if(debug_level.ge.100) print *,avgth,avgqv
if(debug_level.ge.100) call mpas_log_write('$r $r', realArgs=real((/avgth,avgqv/),kind=RKIND))

ELSE

! print *
! print *,' Unknown value for source'
! print *
! print *,' source = ',source
! print *
! stop
write(0,*) 'getcape: unknown value for source'
! call mpas_log_write('')
! call mpas_log_write(' Unknown value for source')
! call mpas_log_write('')
! call mpas_log_write(' source = $i', intArgs=(/source/))
! call mpas_log_write('', messageType=MPAS_LOG_CRIT)
call mpas_log_write('getcape: unknown value for source', messageType=MPAS_LOG_ERR)
return

ENDIF
Expand Down Expand Up @@ -862,13 +861,13 @@ subroutine getcape( nk , p_in , t_in , td_in, cape , cin )
endif

the = getthe(p2,t2,t2,qv2)
if(debug_level.ge.100) print *,' the = ',the
if(debug_level.ge.100) call mpas_log_write(' the = $r', realArgs=(/the/))

!---- begin ascent of parcel ----!

if(debug_level.ge.100)then
print *,' Start loop:'
print *,' p2,th2,qv2 = ',p2,th2,qv2
call mpas_log_write(' Start loop:')
call mpas_log_write(' p2,th2,qv2 = $r $r $r', realArgs=(/p2,th2,qv2/))
endif

do while( doit .and. (k.lt.nk) )
Expand Down Expand Up @@ -932,16 +931,16 @@ subroutine getcape( nk , p_in , t_in , td_in, cape , cin )
+lhs*(qi2-qi1)/(cpm*tbar) &
+(rm/cpm-rd/cp)*alog(p2/p1) )

if(i .gt. 90 .and. debug_level .gt. 0) print *,i,th2,thlast,th2-thlast
if(i .gt. 90 .and. debug_level .gt. 0) call mpas_log_write('$i $r $r $r', intArgs=(/i/), realArgs=(/th2,thlast,th2-thlast/))
if(i .gt. 100)then
! print *
! print *,' Error: lack of convergence'
! print *
! print *,' ... stopping iteration '
! print *
! call mpas_log_write('')
! call mpas_log_write(' Error: lack of convergence')
! call mpas_log_write('')
! call mpas_log_write(' ... stopping iteration ')
! call mpas_log_write('')
! stop 1001
if (debug_level .gt. 0) then
write(0,*) 'getcape: lack of convergence'
call mpas_log_write('getcape: lack of convergence', messageType=MPAS_LOG_ERR)
end if
return
endif
Expand All @@ -963,11 +962,11 @@ subroutine getcape( nk , p_in , t_in , td_in, cape , cin )
ql2 = 0.0
qi2 = 0.0
ELSEIF(adiabat.le.0.or.adiabat.ge.5)THEN
! print *
! print *,' Undefined adiabat'
! print *
! call mpas_log_write('')
! call mpas_log_write(' Undefined adiabat')
! call mpas_log_write('')
! stop 10000
write(0,*) 'getcape: Undefined adiabat'
call mpas_log_write('getcape: Undefined adiabat', messageType=MPAS_LOG_ERR)
return
ENDIF

Expand All @@ -988,11 +987,11 @@ subroutine getcape( nk , p_in , t_in , td_in, cape , cin )
parea = 0.5*b2*dz*frac
narea = narea-0.5*b1*dz*(1.0-frac)
if(debug_level.ge.200)then
print *,' b1,b2 = ',b1,b2
print *,' p1,ps,p2 = ',p(k-1),ps,p(k)
print *,' frac = ',frac
print *,' parea = ',parea
print *,' narea = ',narea
call mpas_log_write(' b1,b2 = $r $r', realArgs=(/b1,b2/))
call mpas_log_write(' p1,ps,p2 = $r $r $r', realArgs=(/p(k-1),ps,p(k)/))
call mpas_log_write(' frac = $r', realArgs=(/frac/))
call mpas_log_write(' parea = $r', realArgs=(/parea/))
call mpas_log_write(' narea = $r', realArgs=(/narea/))
endif
cin = cin + narea
narea = 0.0
Expand All @@ -1003,11 +1002,11 @@ subroutine getcape( nk , p_in , t_in , td_in, cape , cin )
parea = 0.5*b1*dz*frac
narea = -0.5*b2*dz*(1.0-frac)
if(debug_level.ge.200)then
print *,' b1,b2 = ',b1,b2
print *,' p1,ps,p2 = ',p(k-1),ps,p(k)
print *,' frac = ',frac
print *,' parea = ',parea
print *,' narea = ',narea
call mpas_log_write(' b1,b2 = $r $r', realArgs=(/b1,b2/))
call mpas_log_write(' p1,ps,p2 = $r $r $r', realArgs=(/p(k-1),ps,p(k)/))
call mpas_log_write(' frac = $r', realArgs=(/frac/))
call mpas_log_write(' parea = $r', realArgs=(/parea/))
call mpas_log_write(' narea = $r', realArgs=(/narea/))
endif
elseif( b2.lt.0.0 )then
! still collecting negative buoyancy
Expand All @@ -1022,8 +1021,7 @@ subroutine getcape( nk , p_in , t_in , td_in, cape , cin )
cape = cape + max(0.0,parea)

if(debug_level.ge.200)then
write(6,102) p2,b1,b2,cape,cin,cloud
102 format(5(f13.4),2x,l1)
call mpas_log_write('$r $r $r $r $r $l', realArgs=(/p2,b1,b2,cape,cin/), logicArgs=(/cloud/))
endif

if( (p(k).le.10000.0).and.(b2.lt.0.0) )then
Expand Down
Loading

0 comments on commit ece5f71

Please sign in to comment.