From 63514abeee7f1f2334a01b2807a6e833873eee62 Mon Sep 17 00:00:00 2001 From: Gustavo Marques Date: Wed, 27 Mar 2019 10:42:56 -0600 Subject: [PATCH] Repalces end if > endif and end do > enddo --- config_src/nuopc_driver/mom_cap.F90 | 36 +++++----- config_src/nuopc_driver/mom_cap_methods.F90 | 74 ++++++++++----------- config_src/nuopc_driver/mom_cap_time.F90 | 16 ++--- 3 files changed, 63 insertions(+), 63 deletions(-) diff --git a/config_src/nuopc_driver/mom_cap.F90 b/config_src/nuopc_driver/mom_cap.F90 index dceef70804..25bb8c69aa 100644 --- a/config_src/nuopc_driver/mom_cap.F90 +++ b/config_src/nuopc_driver/mom_cap.F90 @@ -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 @@ -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 @@ -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 @@ -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) @@ -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 @@ -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) @@ -1567,7 +1567,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) file=__FILE__)) & return - end if + endif !--------------------------------- ! set scalar data in export state @@ -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, & @@ -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" @@ -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_', & @@ -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__)) & @@ -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 !--------------- @@ -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 @@ -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() @@ -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 diff --git a/config_src/nuopc_driver/mom_cap_methods.F90 b/config_src/nuopc_driver/mom_cap_methods.F90 index ee713846b6..46559fb22a 100644 --- a/config_src/nuopc_driver/mom_cap_methods.F90 +++ b/config_src/nuopc_driver/mom_cap_methods.F90 @@ -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 @@ -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) @@ -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 @@ -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. @@ -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) @@ -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 @@ -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) @@ -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 @@ -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) @@ -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 @@ -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. @@ -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) @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/config_src/nuopc_driver/mom_cap_time.F90 b/config_src/nuopc_driver/mom_cap_time.F90 index cd7f65b88b..dc4f81e90e 100644 --- a/config_src/nuopc_driver/mom_cap_time.F90 +++ b/config_src/nuopc_driver/mom_cap_time.F90 @@ -114,14 +114,14 @@ subroutine AlarmInit( clock, alarm, option, & line=__LINE__, & file=__FILE__, rcToReturn=rc) return - end if + endif if (opt_n <= 0) then call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg=subname//trim(option)//' invalid opt_n', & line=__LINE__, & file=__FILE__, rcToReturn=rc) return - end if + endif endif call ESMF_ClockGet(clock, CurrTime=CurrTime, rc=rc) @@ -179,14 +179,14 @@ subroutine AlarmInit( clock, alarm, option, & line=__LINE__, & file=__FILE__, rcToReturn=rc) return - end if + endif if (lymd < 0 .or. ltod < 0) then call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg=subname//trim(option)//'opt_ymd, opt_tod invalid', & line=__LINE__, & file=__FILE__, rcToReturn=rc) return - end if + endif call ESMF_TimeIntervalSet(AlarmInterval, yy=9999, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & @@ -206,7 +206,7 @@ subroutine AlarmInit( clock, alarm, option, & line=__LINE__, & file=__FILE__, rcToReturn=rc) return - end if + endif call ESMF_TimeIntervalSet(AlarmInterval, mm=1, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & @@ -367,13 +367,13 @@ subroutine TimeInit( Time, ymd, cal, tod, desc, logunit, rc) if (present(logunit)) then write(logunit,*) subname//': ERROR yymmdd is a negative number or '// & 'time-of-day out of bounds', ymd, ltod - end if + endif call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg=subname//' yymmdd is negative or time-of-day out of bounds ', & line=__LINE__, & file=__FILE__, rcToReturn=rc) return - end if + endif call date2ymd (ymd,yr,mon,day) @@ -399,7 +399,7 @@ subroutine date2ymd (date, year, month, day) year = int(tdate/10000) if (date < 0) then year = -year - end if + endif month = int( mod(tdate,10000)/ 100) day = mod(tdate, 100)