Skip to content

Commit

Permalink
Repalces end if > endif and end do > enddo
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-marques committed Mar 27, 2019
1 parent 306bcfb commit 63514ab
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 63 deletions.
36 changes: 18 additions & 18 deletions config_src/nuopc_driver/mom_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
return
endif

end if
endif

ocean_public%is_ocean_pe = .true.
if (len_trim(restartfile) > 0) then
Expand Down Expand Up @@ -1002,7 +1002,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
else
!call fld_list_add(fldsToOcn_num, fldsToOcn, "mass_of_overlying_sea_ice" , "will provide")
!call fld_list_add(fldsFrOcn_num, fldsFrOcn, "sea_lev" , "will provide")
end if
endif

!--------- import fields -------------
call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_salt_rate" , "will provide") ! from ice
Expand Down Expand Up @@ -1199,7 +1199,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
file=__FILE__)) &
return
enddo
end if
endif

!---------------------------------
! Create either a grid or a mesh
Expand Down Expand Up @@ -1250,7 +1250,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)

if (localPet == 0) then
write(logunit,*)'mesh file for mom6 domain is ',trim(cvalue)
end if
endif

! recreate the mesh using the above distGrid
EMesh = ESMF_MeshCreate(EMeshTemp, elementDistgrid=Distgrid, rc=rc)
Expand Down Expand Up @@ -1515,9 +1515,9 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
dataPtr_ycen(i1,j1) = ocean_grid%geolatT(ig,jg)
if(grid_attach_area) then
dataPtr_area(i1,j1) = ocean_grid%areaT(ig,jg)
end if
end do
end do
endif
enddo
enddo

jlast = jec
if(jec == nyg)jlast = jec+1
Expand All @@ -1530,8 +1530,8 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
ig = i + ocean_grid%isc - isc - 1
dataPtr_xcor(i1,j1) = ocean_grid%geolonBu(ig,jg)
dataPtr_ycor(i1,j1) = ocean_grid%geolatBu(ig,jg)
end do
end do
enddo
enddo

write(tmpstr,*) subname//' mask = ',minval(dataPtr_mask),maxval(dataPtr_mask)
call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=rc)
Expand Down Expand Up @@ -1567,7 +1567,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
file=__FILE__)) &
return

end if
endif

!---------------------------------
! set scalar data in export state
Expand Down Expand Up @@ -1655,7 +1655,7 @@ subroutine DataInitialize(gcomp, rc)
line=__LINE__, &
file=__FILE__)) &
return ! bail out
end if
endif

call ESMF_StateGet(exportState, itemCount=fieldCount, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
Expand All @@ -1682,7 +1682,7 @@ subroutine DataInitialize(gcomp, rc)
line=__LINE__, &
file=__FILE__)) &
return ! bail out
end do
enddo
deallocate(fieldNameList)

! check whether all Fields in the exportState are "Updated"
Expand All @@ -1694,7 +1694,7 @@ subroutine DataInitialize(gcomp, rc)
line=__LINE__, &
file=__FILE__)) &
return ! bail out
end if
endif

if(write_diagnostics) then
call NUOPC_Write(exportState, fileNamePrefix='field_init_ocn_export_', &
Expand Down Expand Up @@ -1833,7 +1833,7 @@ subroutine ModelAdvance(gcomp, rc)
call mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary, runtype=runtype, rc=rc)
else
call mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary, rc=rc)
end if
endif
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
Expand Down Expand Up @@ -1962,7 +1962,7 @@ subroutine ModelAdvance(gcomp, rc)

if (is_root_pe()) then
write(logunit,*) subname//' writing restart file ',trim(restartname)
end if
endif
endif

!---------------
Expand Down Expand Up @@ -2124,7 +2124,7 @@ subroutine ModelSetRunClock(gcomp, rc)
file=__FILE__)) &
return ! bail out

end if
endif

!--------------------------------
! Advance model clock to trigger alarms then reset model clock back to currtime
Expand Down Expand Up @@ -2195,7 +2195,7 @@ subroutine ocean_model_finalize(gcomp, rc)
call ocean_model_end(ocean_public, ocean_State, Time, write_restart=.false.)
else
call ocean_model_end(ocean_public, ocean_State, Time, write_restart=.true.)
end if
endif
call field_manager_end()

call fms_io_exit()
Expand Down Expand Up @@ -2325,7 +2325,7 @@ subroutine MOM_RealizeFields(state, nfields, field_defs, tag, grid, mesh, rc)
return ! bail out
fldptr1d(:) = 0.0

end if
endif

endif

Expand Down
74 changes: 37 additions & 37 deletions config_src/nuopc_driver/mom_cap_methods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary,
do_import = .false. ! This will skip the first time import information is given
else
do_import = .true.
end if
endif
else
do_import = .true.
end if
endif

if (do_import) then
! The following are global indices without halos
Expand Down Expand Up @@ -182,8 +182,8 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary,
- ocean_grid%sin_rot(ig,jg)*tauy(i,j)
ice_ocean_boundary%v_flux(i,j) = ocean_grid%cos_rot(ig,jg)*tauy(i,j) &
+ ocean_grid%sin_rot(ig,jg)*taux(i,j)
end do
end do
enddo
enddo

deallocate(taux, tauy)

Expand Down Expand Up @@ -335,7 +335,7 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary,
file=__FILE__)) &
return ! bail out

end if
endif

end subroutine mom_import

Expand Down Expand Up @@ -390,7 +390,7 @@ subroutine mom_export(ocean_public, ocean_grid, ocean_state, exportState, clock,
inv_dt_int = 1.0 / real(dt_int)
else
inv_dt_int = 0.0
end if
endif

!----------------
! Copy from ocean_public to exportstate.
Expand Down Expand Up @@ -460,8 +460,8 @@ subroutine mom_export(ocean_public, ocean_grid, ocean_state, exportState, clock,
ocm(i,j) = ocean_public%v_surf(i,j)
ocz_rot(i,j) = ocean_grid%cos_rot(ig,jg)*ocz(i,j) + ocean_grid%sin_rot(ig,jg)*ocm(i,j)
ocm_rot(i,j) = ocean_grid%cos_rot(ig,jg)*ocm(i,j) - ocean_grid%sin_rot(ig,jg)*ocz(i,j)
end do
end do
enddo
enddo

call State_SetExport(exportState, 'ocn_current_zonal', &
isc, iec, jsc, jec, ocz_rot, ocean_grid, rc=rc)
Expand Down Expand Up @@ -490,7 +490,7 @@ subroutine mom_export(ocean_public, ocean_grid, ocean_state, exportState, clock,
line=__LINE__, &
file=__FILE__)) &
return ! bail out
end if
endif

! -------
! Freezing melting potential
Expand All @@ -507,9 +507,9 @@ subroutine mom_export(ocean_public, ocean_grid, ocean_state, exportState, clock,
else
melt_potential(i,j) = -ocean_public%melt_potential(i,j) * inv_dt_int
if (melt_potential(i,j) > 0.0) melt_potential(i,j) = 0.0
end if
end do
end do
endif
enddo
enddo

call State_SetExport(exportState, 'freezing_melting_potential', &
isc, iec, jsc, jec, melt_potential, ocean_grid, rc=rc)
Expand All @@ -531,7 +531,7 @@ subroutine mom_export(ocean_public, ocean_grid, ocean_state, exportState, clock,
line=__LINE__, &
file=__FILE__)) &
return ! bail out
end if
endif

!----------------
! Sea-surface zonal and meridional slopes
Expand All @@ -553,8 +553,8 @@ subroutine mom_export(ocean_public, ocean_grid, ocean_state, exportState, clock,
do i = ocean_grid%isc,ocean_grid%iec
iloc = i + ocean_grid%idg_offset
ssh(i,j) = ocean_public%sea_lev(iloc,jloc)
end do
end do
enddo
enddo

! Update halo of ssh so we can calculate gradients (local indexing)
call pass_var(ssh, ocean_grid%domain)
Expand Down Expand Up @@ -583,11 +583,11 @@ subroutine mom_export(ocean_public, ocean_grid, ocean_state, exportState, clock,
! Extrema in the mean values require a PCM reconstruction avoid generating
! larger extreme values.
slope = 0.0
end if
endif
dhdx(iglob,jglob) = slope * ocean_grid%IdxT(i,j) * ocean_grid%mask2dT(i,j)
if (ocean_grid%mask2dT(i,j)==0.) dhdx(iglob,jglob) = 0.0
end do
end do
enddo
enddo

! d/dy ssh
! This is a simple second-order difference
Expand All @@ -613,11 +613,11 @@ subroutine mom_export(ocean_public, ocean_grid, ocean_state, exportState, clock,
! Extrema in the mean values require a PCM reconstruction avoid generating
! larger extreme values.
slope = 0.0
end if
endif
dhdy(iglob,jglob) = slope * ocean_grid%IdyT(i,j) * ocean_grid%mask2dT(i,j)
if (ocean_grid%mask2dT(i,j)==0.) dhdy(iglob,jglob) = 0.0
end do
end do
enddo
enddo

! rotate slopes from tripolar grid back to lat/lon grid, x,y => latlon (CCW)
! "ocean_grid" uses has halos and uses local indexing.
Expand All @@ -628,8 +628,8 @@ subroutine mom_export(ocean_public, ocean_grid, ocean_state, exportState, clock,
ig = i + ocean_grid%isc - isc
dhdx_rot(i,j) = ocean_grid%cos_rot(ig,jg)*dhdx(i,j) + ocean_grid%sin_rot(ig,jg)*dhdy(i,j)
dhdy_rot(i,j) = ocean_grid%cos_rot(ig,jg)*dhdy(i,j) - ocean_grid%sin_rot(ig,jg)*dhdx(i,j)
end do
end do
enddo
enddo

call State_SetExport(exportState, 'sea_surface_slope_zonal', &
isc, iec, jsc, jec, dhdx_rot, ocean_grid, rc=rc)
Expand Down Expand Up @@ -751,9 +751,9 @@ subroutine State_GetImport(state, fldname, isc, iec, jsc, jec, output, do_sum, r
output(i,j) = output(i,j) + dataPtr1d(n)
else
output(i,j) = dataPtr1d(n)
end if
end do
end do
endif
enddo
enddo

else if (geomtype == ESMF_GEOMTYPE_GRID) then

Expand All @@ -774,13 +774,13 @@ subroutine State_GetImport(state, fldname, isc, iec, jsc, jec, output, do_sum, r
output(i,j) = output(i,j) + dataPtr2d(i1,j1)
else
output(i,j) = dataPtr2d(i1,j1)
end if
end do
end do
endif
enddo
enddo

end if
endif

end if
endif

end subroutine State_GetImport

Expand Down Expand Up @@ -833,8 +833,8 @@ subroutine State_SetExport(state, fldname, isc, iec, jsc, jec, input, ocean_grid
ig = i + ocean_grid%isc - isc
n = n+1
dataPtr1d(n) = input(i,j) * ocean_grid%mask2dT(ig,jg)
end do
end do
enddo
enddo

else if (geomtype == ESMF_GEOMTYPE_GRID) then

Expand All @@ -854,12 +854,12 @@ subroutine State_SetExport(state, fldname, isc, iec, jsc, jec, input, ocean_grid
i1 = i + lbnd1 - isc
ig = i + ocean_grid%isc - isc
dataPtr2d(i1,j1) = input(i,j) * ocean_grid%mask2dT(ig,jg)
end do
end do
enddo
enddo

end if
endif

end if
endif

end subroutine State_SetExport

Expand Down
Loading

0 comments on commit 63514ab

Please sign in to comment.