Skip to content

Commit 2507b5e

Browse files
committed
Merge remote-tracking branch 'ESCOMP/development' into check-out-variables
2 parents 53d931a + 8a0689e commit 2507b5e

12 files changed

+3309
-2757
lines changed

src/cpl/nuopc/atm_import_export.F90

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,8 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc)
469469
use physconst , only : mwco2
470470
use time_manager , only : is_first_step, get_nstep
471471
use physics_grid , only : columns_on_task
472+
use runtime_obj , only : wv_stdname
473+
use ccpp_scheme_utils , only : ccpp_constituent_index
472474

473475
! input/output variabes
474476
type(ESMF_GridComp) :: gcomp
@@ -479,12 +481,15 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc)
479481
! local variables
480482
type(ESMF_State) :: importState
481483
integer :: i,n ! loop indices
484+
integer :: ierr
482485
integer :: nstep
486+
integer :: wv_const_index
483487
logical :: overwrite_flds
484488
logical :: exists
485489
logical :: exists_fco2_ocn
486490
logical :: exists_fco2_lnd
487491
character(len=128) :: fldname
492+
character(len=512) :: errmsg
488493
real(r8), pointer :: fldptr2d(:,:)
489494
real(r8), pointer :: fldptr1d(:)
490495
real(r8), pointer :: fldptr_lat(:)
@@ -522,6 +527,14 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc)
522527
overwrite_flds = .true.
523528
if (present(restart_init)) overwrite_flds = .not. restart_init
524529

530+
! Find CCPP constituents index for water vapor,
531+
! as it is needed to properly pass evaporation into
532+
! the constituent fluxes array:
533+
call ccpp_constituent_index(wv_stdname, wv_const_index, ierr, errmsg)
534+
if (ierr /= 0) then
535+
call shr_sys_abort(subname//':: Failed to get water vapor CCPP constituent index with the following error: '//errmsg)
536+
end if
537+
525538
!--------------------------
526539
! Required atmosphere input fields
527540
!--------------------------
@@ -536,10 +549,13 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc)
536549
call state_getfldptr(importState, 'Faxx_evap', fldptr=fldptr_evap, rc=rc)
537550
if (ChkErr(rc,__LINE__,u_FILE_u)) return
538551
do i = 1, columns_on_task
539-
cam_in%wsx(i) = -fldptr_taux(i) * med2mod_areacor(i)
540-
cam_in%wsy(i) = -fldptr_tauy(i) * med2mod_areacor(i)
541-
cam_in%shf(i) = -fldptr_sen(i) * med2mod_areacor(i)
542-
cam_in%cflx(i,1) = -fldptr_evap(i) * med2mod_areacor(i)
552+
cam_in%wsx(i) = -fldptr_taux(i) * med2mod_areacor(i)
553+
cam_in%wsy(i) = -fldptr_tauy(i) * med2mod_areacor(i)
554+
cam_in%shf(i) = -fldptr_sen(i) * med2mod_areacor(i)
555+
!Add water vapor to constituent fluxes array if present:
556+
if (wv_const_index > 0) then
557+
cam_in%cflx(i, wv_const_index) = -fldptr_evap(i) * med2mod_areacor(i)
558+
end if
543559
end do
544560
end if ! end of overwrite_flds
545561

@@ -678,7 +694,7 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc)
678694
#endif
679695

680696
#if 0
681-
! Ignoring depvel for now as it has a problematic second dimension (number of dry deposited species)
697+
! Ignoring depvel for now as it has a problematic second dimension (number of dry deposited species)
682698
! and it was determined that it probably will not be used in CAM-SIMA for some time
683699
! dry dep velocities
684700
call state_getfldptr(importState, 'Sl_ddvel', fldptr2d=fldptr2d, exists=exists, rc=rc)

src/dynamics/mpas/assets/Makefile.in.CESM

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,14 @@ libmpas-apply-patch:
109109

110110
# Combine multiple static libraries into `libmpas.a` via archiver/MRI script. This requires GNU or GNU-like archiver (`ar`) program.
111111
libmpas-archiver-script.txt:
112-
@echo "create libmpas.a" > $(@)
113-
@echo "addlib libdycore.a" >> $(@)
114-
@echo "addlib libframework.a" >> $(@)
115-
@echo "addlib libops.a" >> $(@)
116-
@echo "addmod dyn_mpas_subdriver.o" >> $(@)
117-
@echo "save" >> $(@)
118-
@echo "end" >> $(@)
112+
@echo "create libmpas.a" > $(@)
113+
@echo "addlib libdycore.a" >> $(@)
114+
@echo "addlib libframework.a" >> $(@)
115+
@echo "addlib libops.a" >> $(@)
116+
@echo "addmod dyn_mpas_procedures.o" >> $(@)
117+
@echo "addmod dyn_mpas_subdriver.o" >> $(@)
118+
@echo "save" >> $(@)
119+
@echo "end" >> $(@)
119120

120121
.PHONY: libmpas-preview
121122
libmpas-preview: libmpas-apply-patch libmpas-archiver-script.txt
@@ -161,7 +162,9 @@ endif
161162
( cd external; $(MAKE) FC="$(FC)" SFC="$(SFC)" CC="$(CC)" SCC="$(SCC)" FFLAGS="$(FFLAGS)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" NETCDF="$(NETCDF)" CORE="$(CORE)" ezxml-lib )
162163

163164
.PHONY: subdrv
164-
subdrv: driver/dyn_mpas_subdriver.o
165+
subdrv: driver/dyn_mpas_procedures.o driver/dyn_mpas_subdriver.o
166+
167+
driver/dyn_mpas_subdriver.o: driver/dyn_mpas_procedures.o
165168

166169
%.o: %.F90 dycore frame ops
167170
( cd $(<D); $(FC) $(CPPFLAGS) $(FFLAGS) -c $(<F) $(CPPINCLUDES) $(FCINCLUDES) -I../framework -I../operators -I../core_$(CORE) -I../core_$(CORE)/dynamics )

0 commit comments

Comments
 (0)