Skip to content

Commit 52a939a

Browse files
committed
Merge remote-tracking branch 'origin/cam_ifx_CTSM' into cam_ifx
2 parents 569d64a + 8d8cc3d commit 52a939a

4 files changed

Lines changed: 46 additions & 14 deletions

File tree

.gitmodules

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ fxDONOTUSEurl = https://github.com/ESCOMP/RTM
124124

125125
[submodule "mosart"]
126126
path = components/mosart
127-
url = https://github.com/ESCOMP/MOSART
128-
fxtag = mosart1.1.12
127+
url = https://github.com/billsacks/MOSART
128+
fxtag = 7aa48b1
129129
fxrequired = ToplevelRequired
130130
fxDONOTUSEurl = https://github.com/ESCOMP/MOSART
131131

@@ -187,8 +187,8 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CESM_CICE
187187

188188
[submodule "clm"]
189189
path = components/clm
190-
url = https://github.com/ESCOMP/CTSM
191-
fxtag = alpha-ctsm5.4.CMIP7.09.ctsm5.3.068
190+
url = https://github.com/billsacks/CTSM
191+
fxtag = c7230f0
192192
fxrequired = ToplevelRequired
193193
fxDONOTUSEurl = https://github.com/ESCOMP/CTSM
194194

src/dynamics/se/dyn_comp.F90

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,7 +2217,18 @@ subroutine read_dyn_field_2d(fieldname, fh, dimname, buffer)
22172217
! to NaN. In that case infld can return NaNs where the element GLL points
22182218
! are not "unique columns"
22192219
! Set NaNs or fillvalue points to zero
2220-
where (isnan(buffer) .or. (buffer==fillvalue)) buffer = 0.0_r8
2220+
where (isnan(buffer))
2221+
! check for NaN first, as comparing NaN to fillvalue raises floating invalid.
2222+
buffer = 0.0_r8
2223+
end where
2224+
2225+
if (.not. isnan(fillvalue)) then
2226+
! only compare against fillvalue if fillvalue is not NaN, otherwise the comparison
2227+
! will raise floating invalid.
2228+
where (buffer == fillvalue)
2229+
buffer = 0.0_r8
2230+
end where
2231+
end if
22212232

22222233
end subroutine read_dyn_field_2d
22232234

@@ -2247,7 +2258,18 @@ subroutine read_dyn_field_3d(fieldname, fh, dimname, buffer)
22472258
! to NaN. In that case infld can return NaNs where the element GLL points
22482259
! are not "unique columns"
22492260
! Set NaNs or fillvalue points to zero
2250-
where (isnan(buffer) .or. (buffer == fillvalue)) buffer = 0.0_r8
2261+
where (isnan(buffer))
2262+
! check for NaN first, as comparing NaN to fillvalue raises floating invalid.
2263+
buffer = 0.0_r8
2264+
end where
2265+
2266+
if (.not. isnan(fillvalue)) then
2267+
! only compare against fillvalue if fillvalue is not NaN, otherwise the comparison
2268+
! will raise floating invalid.
2269+
where (buffer == fillvalue)
2270+
buffer = 0.0_r8
2271+
end where
2272+
end if
22512273

22522274
end subroutine read_dyn_field_3d
22532275

src/ionosphere/waccmx/edyn_mpi.F90

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,7 +1684,7 @@ subroutine mp_mag_jslot(fin,mlon00,mlon11,mlat00,mlat11, &
16841684
integer :: ier,njneed,i,j,n,nj,idest, &
16851685
icount,len,nlons,isrc,msgid,ifld,sndbuf_cntr
16861686
integer :: tij ! rank in cols_comm (0 to nmagtaskj-1)
1687-
integer :: jhave(mxneed),njhave,wid
1687+
integer :: jhave(mxneed),njhave
16881688
integer :: peersneed(mxneed,0:nmagtaskj-1)
16891689
integer :: jneedall (mxneed,0:nmagtaskj-1)
16901690
real(r8) :: sndbuf(mxmaglon+2,mxneed,nf,sndbuf_cntr_max)
@@ -1730,7 +1730,6 @@ subroutine mp_mag_jslot(fin,mlon00,mlon11,mlat00,mlat11, &
17301730
njhave = njhave+1
17311731
jhave(njhave) = peersneed(j,n)
17321732
idest = n
1733-
wid = itask_table_geo(mytidi,idest)
17341733
endif
17351734
enddo
17361735
if (njhave > 0) then
@@ -1749,7 +1748,9 @@ subroutine mp_mag_jslot(fin,mlon00,mlon11,mlat00,mlat11, &
17491748
enddo
17501749
enddo
17511750
len = nlons*njhave*nf
1752-
msgid = mytid+wid*10000
1751+
! sending tag uniquely identifies sender - tij is comm. rank
1752+
! within this communicator only.
1753+
msgid = tij
17531754
call mpi_ibsend(sndbuf(1:nlons,1:njhave,:,sndbuf_cntr),len,MPI_REAL8, &
17541755
idest,msgid,cols_comm,ibsend_requests(sndbuf_cntr),ier)
17551756
if (ier /= 0) &
@@ -1783,7 +1784,8 @@ subroutine mp_mag_jslot(fin,mlon00,mlon11,mlat00,mlat11, &
17831784
isrc = tasks(n)%magtidj ! task id in cols_comm to recv from
17841785
nlons = mlon11-mlon00+1
17851786
len = nlons*njhave*nf
1786-
msgid = mytid*10000+n
1787+
! receive tag is sender rank (tij from sender == magtidj)
1788+
msgid = isrc
17871789
rcvbuf = 0._r8
17881790
call mpi_recv(rcvbuf(1:nlons,1:njhave,:),len,MPI_REAL8, &
17891791
isrc,msgid,cols_comm,irstat,ier)

src/physics/rrtmgp/rrtmgp_inputs_cam.F90

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,19 @@ subroutine rrtmgp_set_aer_sw( &
198198
! set aerosol optical depth, clip to zero
199199
aer_sw%optical_props%tau(i,ktoprad:,:) = max(aer_tau(idxday(i),ktopcam:,:), 0._r8)
200200
! set value of single scattering albedo
201-
aer_sw%optical_props%ssa(i,ktoprad:,:) = merge(aer_tau_w(idxday(i),ktopcam:,:)/aer_tau(idxday(i),ktopcam:,:), &
202-
1._r8, aer_tau(idxday(i),ktopcam:,:) > 0._r8)
201+
where (aer_tau(idxday(i),ktopcam:,:) > 0._r8)
202+
aer_sw%optical_props%ssa(i,ktoprad:,:) = aer_tau_w(idxday(i),ktopcam:,:) &
203+
/ aer_tau(idxday(i),ktopcam:,:)
204+
elsewhere
205+
aer_sw%optical_props%ssa(i,ktoprad:,:) = 1._r8
206+
end where
203207
! set value of asymmetry
204-
aer_sw%optical_props%g(i,ktoprad:,:) = merge(aer_tau_w_g(idxday(i),ktopcam:,:)/aer_tau_w(idxday(i),ktopcam:,:), &
205-
0._r8, aer_tau_w(idxday(i),ktopcam:,:) > tiny)
208+
where (aer_tau_w(idxday(i),ktopcam:,:) > tiny)
209+
aer_sw%optical_props%g(i,ktoprad:,:) = aer_tau_w_g(idxday(i),ktopcam:,:) &
210+
/ aer_tau_w(idxday(i),ktopcam:,:)
211+
elsewhere
212+
aer_sw%optical_props%g(i,ktoprad:,:) = 0._r8
213+
end where
206214
end do
207215

208216
! impose limits on the components

0 commit comments

Comments
 (0)