diff --git a/driver/fvGFS/atmosphere.F90 b/driver/fvGFS/atmosphere.F90 index dc4e208fa..db9c42ab3 100644 --- a/driver/fvGFS/atmosphere.F90 +++ b/driver/fvGFS/atmosphere.F90 @@ -2390,6 +2390,72 @@ subroutine atmosphere_fill_nest_cpl(Atm_block, IPD_control, IPD_data) endif endif + ! Deal with usfco and vsfco + if (IPD_control%cplocn2atm .and. IPD_control%icplocn2atm==1) then + ! Extract the coupling field + do nb = 1,Atm_block%nblks + blen = Atm_block%blksz(nb) + do ix = 1, blen + i = Atm_block%index(nb)%ii(ix) + j = Atm_block%index(nb)%jj(ix) + Atm(mygrid)%parent2nest_2d(i,j) = IPD_Data(nb)%Sfcprop%usfco(ix) + enddo + enddo + ! Loop through and fill all nested grids + do n=2,ngrids + if (n==mygrid .or. mygrid==Atm(n)%parent_grid%grid_number) then + call fill_nested_grid_cpl(n, n==mygrid) + endif + enddo + ! Update the nested grids + if (Atm(mygrid)%neststruct%nested) then + do nb = 1,Atm_block%nblks + blen = Atm_block%blksz(nb) + do ix = 1, blen + i = Atm_block%index(nb)%ii(ix) + j = Atm_block%index(nb)%jj(ix) + if (IPD_data(nb)%Sfcprop%oceanfrac(ix) > 0.) then + IPD_data(nb)%Sfcprop%usfco(ix) = Atm(mygrid)%parent2nest_2d(i,j) + else + IPD_data(nb)%Sfcprop%usfco(ix) = 0.0_kind_phys + endif + enddo + enddo + endif + + ! Extract the coupling field + do nb = 1,Atm_block%nblks + blen = Atm_block%blksz(nb) + do ix = 1, blen + i = Atm_block%index(nb)%ii(ix) + j = Atm_block%index(nb)%jj(ix) + Atm(mygrid)%parent2nest_2d(i,j) = IPD_Data(nb)%Sfcprop%vsfco(ix) + enddo + enddo + ! Loop through and fill all nested grids + do n=2,ngrids + if (n==mygrid .or. mygrid==Atm(n)%parent_grid%grid_number) then + call fill_nested_grid_cpl(n, n==mygrid) + endif + enddo + ! Update the nested grids + if (Atm(mygrid)%neststruct%nested) then + do nb = 1,Atm_block%nblks + blen = Atm_block%blksz(nb) + do ix = 1, blen + i = Atm_block%index(nb)%ii(ix) + j = Atm_block%index(nb)%jj(ix) + if (IPD_data(nb)%Sfcprop%oceanfrac(ix) > 0.) then + IPD_data(nb)%Sfcprop%vsfco(ix) = Atm(mygrid)%parent2nest_2d(i,j) + else + IPD_data(nb)%Sfcprop%vsfco(ix) = 0.0_kind_phys + endif + enddo + enddo + endif + + endif + ! Deal with zorlwav (sea surface roughness length) if (IPD_control%cplwav2atm) then ! Extract the coupling field