Skip to content

Commit 8a51d58

Browse files
committed
Change "end if" to endif and "end do" to enddo
Replaced "end if" with "endif" in 35 places in 10 files and "end do" with "enddo" in 12 places in 4 files to comply with the MOM6 style guide. In addition, in 23 places in 7 files, code like `if(test)` were replaced with `if (test)`, also to align with the MOM6 style guide. All answers are bitwise identical.
1 parent 8a009b1 commit 8a51d58

17 files changed

Lines changed: 75 additions & 75 deletions

config_src/drivers/STALE_mct_cap/mom_ocean_model_mct.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, &
585585
call disable_averaging(OS%diag)
586586
Master_time = OS%Time ; Time1 = OS%Time
587587

588-
if(OS%offline_tracer_mode) then
588+
if (OS%offline_tracer_mode) then
589589
call step_offline(OS%forces, OS%fluxes, OS%sfc_state, Time1, dt_coupling, OS%MOM_CSp)
590590

591591
elseif ((.not.do_thermo) .or. (.not.do_dyn)) then
@@ -808,7 +808,7 @@ subroutine initialize_ocean_public_type(input_domain, Ocean_sfc, diag, maskmap,
808808

809809
call mpp_get_layout(input_domain,layout)
810810
call mpp_get_global_domain(input_domain, xsize=xsz, ysize=ysz)
811-
if(PRESENT(maskmap)) then
811+
if (PRESENT(maskmap)) then
812812
call mpp_define_domains((/1,xsz,1,ysz/),layout,Ocean_sfc%Domain, maskmap=maskmap)
813813
else
814814
call mpp_define_domains((/1,xsz,1,ysz/),layout,Ocean_sfc%Domain)

config_src/drivers/STALE_mct_cap/mom_surface_forcing_mct.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,14 +439,14 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
439439
fluxes%lrunoff(i,j) = kg_m2_s_conversion * IOB%rofl_flux(i-i0,j-j0) * G%mask2dT(i,j)
440440
else if (associated(IOB%runoff)) then
441441
fluxes%lrunoff(i,j) = kg_m2_s_conversion * IOB%runoff(i-i0,j-j0) * G%mask2dT(i,j)
442-
end if
442+
endif
443443

444444
! ice runoff flux
445445
if (associated(IOB%rofi_flux)) then
446446
fluxes%frunoff(i,j) = kg_m2_s_conversion * IOB%rofi_flux(i-i0,j-j0) * G%mask2dT(i,j)
447447
else if (associated(IOB%calving)) then
448448
fluxes%frunoff(i,j) = kg_m2_s_conversion * IOB%calving(i-i0,j-j0) * G%mask2dT(i,j)
449-
end if
449+
endif
450450

451451
if (associated(IOB%ustar_berg)) &
452452
fluxes%ustar_berg(i,j) = US%m_to_Z*US%T_to_s * IOB%ustar_berg(i-i0,j-j0) * G%mask2dT(i,j)

config_src/drivers/STALE_mct_cap/ocn_comp_mct.F90

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
201201

202202
! set the shr log io unit number
203203
call shr_file_setLogUnit(stdout)
204-
end if
204+
endif
205205

206206
call set_calendar_type(NOLEAP) !TODO: confirm this
207207

@@ -316,13 +316,13 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
316316
close(nu)
317317
if (is_root_pe()) then
318318
write(stdout,*) 'Reading restart file(s): ',trim(restartfiles)
319-
end if
319+
endif
320320
call shr_file_freeUnit(nu)
321321
call ocean_model_init(glb%ocn_public, glb%ocn_state, time0, time_start, input_restart_file=trim(restartfiles))
322322
endif
323323
if (is_root_pe()) then
324324
write(stdout,'(/12x,a/)') '======== COMPLETED MOM INITIALIZATION ========'
325-
end if
325+
endif
326326

327327
! Initialize ocn_state%sfc_state out of sight
328328
call ocean_model_init_sfc(glb%ocn_state, glb%ocn_public)
@@ -384,14 +384,14 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
384384
if (mom_cpl_dt /= ocn_cpl_dt) then
385385
write(stdout,*) 'ERROR mom_cpl_dt and ocn_cpl_dt must be identical'
386386
call exit(0)
387-
end if
387+
endif
388388

389389
! send initial state to driver
390390

391391
!TODO:
392392
! if ( lsend_precip_fact ) then
393393
! call seq_infodata_PutData( infodata, precip_fact=precip_fact)
394-
! end if
394+
! endif
395395

396396
if (debug .and. root_pe().eq.pe_here()) print *, "calling ocn_export"
397397
call ocn_export(glb%ind, glb%ocn_public, glb%grid, o2x_o%rattr, mom_cpl_dt, ncouple_per_day)
@@ -412,7 +412,7 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
412412
if (is_root_pe()) then
413413
call shr_file_setLogUnit (shrlogunit)
414414
call shr_file_setLogLevel(shrloglev)
415-
end if
415+
endif
416416

417417
end subroutine ocn_init_mct
418418

@@ -488,10 +488,10 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)
488488
time_start = time_start-coupling_timestep
489489
! double the first coupling interval (to account for the missing coupling interval to due to lag)
490490
coupling_timestep = coupling_timestep*2
491-
end if
491+
endif
492492

493493
firstCall = .false.
494-
end if
494+
endif
495495

496496
! Debugging clocks
497497
if (debug .and. is_root_pe()) then
@@ -526,7 +526,7 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)
526526
c1=glb%c1, c2=glb%c2, c3=glb%c3, c4=glb%c4)
527527
else
528528
call ocn_import(x2o_o%rattr, glb%ind, glb%grid, Ice_ocean_boundary, glb%ocn_public, stdout, Eclock )
529-
end if
529+
endif
530530

531531
! Update internal ocean
532532
call update_ocean_model(ice_ocean_boundary, glb%ocn_state, glb%ocn_public, time_start, coupling_timestep)
@@ -760,7 +760,7 @@ end subroutine ocn_domain_mct
760760
else
761761
write(stdout,*) 'ocn_comp_mct ERROR: unknown starttype'
762762
call exit(0)
763-
end if
763+
endif
764764
return
765765

766766
end function

config_src/drivers/nuopc_cap/mom_cap.F90

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc)
431431
if (ChkErr(rc,__LINE__,u_FILE_u)) return
432432
if (isPresent .and. isSet) then
433433
if (trim(value) .eq. '.true.') restart_eor = .true.
434-
end if
434+
endif
435435

436436
if (localPet == 0) call cap_profiling("mom", "InitializeP0", "E")
437437

@@ -506,7 +506,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
506506

507507
if (localPet == 0) call cap_profiling("mom", "InitializeAdvertise", "B")
508508

509-
if(write_runtimelog) timeiads = MPI_Wtime()
509+
if (write_runtimelog) timeiads = MPI_Wtime()
510510

511511
call ESMF_LogWrite(subname//' enter', ESMF_LOGMSG_INFO)
512512

@@ -571,7 +571,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
571571

572572
if (cesm_coupled) then
573573
! Multiinstance logfile name needs a correction
574-
if(len_trim(inst_suffix) > 0) then
574+
if (len_trim(inst_suffix) > 0) then
575575
n = index(logfile, '.')
576576
logfile = logfile(1:n-1)//trim(inst_suffix)//logfile(n:)
577577
endif
@@ -660,7 +660,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
660660
if (is_root_pe()) then
661661
write(stdout,*) 'ice_ncat = ', Ice_ocean_boundary%ice_ncat
662662
endif
663-
end if
663+
endif
664664

665665
if (is_root_pe()) then
666666
write(stdout,*) subname//'start time: y,m,d-',year,month,day,'h,m,s=',hour,minute,second
@@ -945,7 +945,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
945945
call NUOPC_Advertise(exportState, standardName=fldsFrOcn(n)%stdname, name=fldsFrOcn(n)%shortname, rc=rc)
946946
if (ChkErr(rc,__LINE__,u_FILE_u)) return
947947
enddo
948-
if(write_runtimelog .and. is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', MPI_Wtime()-timeiads
948+
if (write_runtimelog .and. is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', MPI_Wtime()-timeiads
949949

950950
if (localPet == 0) call cap_profiling("mom", "InitializeAdvertise", "E")
951951

@@ -1044,7 +1044,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
10441044

10451045
if (localPet == 0) call cap_profiling("mom", "InitializeRealize", "B")
10461046

1047-
if(write_runtimelog) timeirls = MPI_Wtime()
1047+
if (write_runtimelog) timeirls = MPI_Wtime()
10481048

10491049
call shr_log_setLogUnit (stdout)
10501050

@@ -1253,7 +1253,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
12531253
do n = 1,numOwnedElements
12541254
lonMesh(n) = ownedElemCoords(2*n-1)
12551255
latMesh(n) = ownedElemCoords(2*n)
1256-
end do
1256+
enddo
12571257

12581258
elemMaskArray = ESMF_ArrayCreate(Distgrid, maskMesh, rc=rc)
12591259
if (ChkErr(rc,__LINE__,u_FILE_u)) return
@@ -1270,8 +1270,8 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
12701270
mask(n) = ocean_grid%mask2dT(ig,jg)
12711271
lon(n) = ocean_grid%geolonT(ig,jg)
12721272
lat(n) = ocean_grid%geolatT(ig,jg)
1273-
end do
1274-
end do
1273+
enddo
1274+
enddo
12751275

12761276
eps_omesh = get_eps_omesh(ocean_state)
12771277
do n = 1,lsize
@@ -1297,7 +1297,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
12971297
write(err_msg, frmt)n,maskMesh(n),mask(n)
12981298
call MOM_error(FATAL, err_msg)
12991299
endif
1300-
end do
1300+
enddo
13011301

13021302
! realize the import and export fields using the mesh
13031303
call MOM_RealizeFields(importState, fldsToOcn_num, fldsToOcn, "Ocn import", &
@@ -1342,8 +1342,8 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
13421342
mod2med_areacor(k) = model_areas(k) / mesh_areas(k)
13431343
med2mod_areacor(k) = mesh_areas(k) / model_areas(k)
13441344
endif
1345-
end do
1346-
end do
1345+
enddo
1346+
enddo
13471347
deallocate(mesh_areas)
13481348
deallocate(model_areas)
13491349

@@ -1621,7 +1621,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
16211621
if (use_cdeps_inline) then
16221622
call mom_inline_init(gcomp, clock, eMesh, localPet, rc=rc)
16231623
if (ChkErr(rc,__LINE__,u_FILE_u)) return
1624-
end if
1624+
endif
16251625

16261626
!---------------------------------
16271627
! write out diagnostics
@@ -1632,7 +1632,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
16321632
!if (ChkErr(rc,__LINE__,u_FILE_u)) return
16331633

16341634
timere = 0.
1635-
if(write_runtimelog .and. is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', MPI_Wtime()-timeirls
1635+
if (write_runtimelog .and. is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', MPI_Wtime()-timeirls
16361636

16371637
if (localPet == 0) call cap_profiling("mom", "InitializeRealize", "E")
16381638

@@ -1669,7 +1669,7 @@ subroutine DataInitialize(gcomp, rc)
16691669

16701670
if (localPet == 0) call cap_profiling("mom", "DataInitialize", "B")
16711671

1672-
if(write_runtimelog) timedis = MPI_Wtime()
1672+
if (write_runtimelog) timedis = MPI_Wtime()
16731673

16741674
! query the Component for its clock, importState and exportState
16751675
call ESMF_GridCompGet(gcomp, clock=clock, importState=importState, exportState=exportState, rc=rc)
@@ -1731,7 +1731,7 @@ subroutine DataInitialize(gcomp, rc)
17311731
enddo
17321732
endif
17331733

1734-
if(write_runtimelog .and. is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', MPI_Wtime()-timedis
1734+
if (write_runtimelog .and. is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', MPI_Wtime()-timedis
17351735

17361736
if (localPet == 0) call cap_profiling("mom", "DataInitialize", "E")
17371737

@@ -1793,10 +1793,10 @@ subroutine ModelAdvance(gcomp, rc)
17931793

17941794
if (localPet == 0) call cap_profiling("mom", "ModelAdvance", "B")
17951795

1796-
if(profile_memory) call ESMF_VMLogMemInfo("Entering MOM Model_ADVANCE: ")
1797-
if(write_runtimelog) then
1796+
if (profile_memory) call ESMF_VMLogMemInfo("Entering MOM Model_ADVANCE: ")
1797+
if (write_runtimelog) then
17981798
timers = MPI_Wtime()
1799-
if(timere>0. .and. is_root_pe()) write(stdout,*) 'In ',trim(subname),' time since last time step ',timers-timere
1799+
if (timere>0. .and. is_root_pe()) write(stdout,*) 'In ',trim(subname),' time since last time step ',timers-timere
18001800
endif
18011801

18021802
call shr_log_setLogUnit (stdout)
@@ -1911,7 +1911,7 @@ subroutine ModelAdvance(gcomp, rc)
19111911
if (use_cdeps_inline) then
19121912
call mom_inline_run(clock, ocean_public, ocean_grid, ice_ocean_boundary, dbug, rc=rc)
19131913
if (ChkErr(rc,__LINE__,u_FILE_u)) return
1914-
end if
1914+
endif
19151915

19161916
!---------------
19171917
! Update MOM6
@@ -1956,7 +1956,7 @@ subroutine ModelAdvance(gcomp, rc)
19561956
! turn off the alarm
19571957
call ESMF_AlarmRingerOff(restart_alarm, rc=rc )
19581958
if (ChkErr(rc,__LINE__,u_FILE_u)) return
1959-
end if
1959+
endif
19601960

19611961
write_restart_eor = .false.
19621962
if (restart_eor) then
@@ -1966,8 +1966,8 @@ subroutine ModelAdvance(gcomp, rc)
19661966
! turn off the alarm
19671967
call ESMF_AlarmRingerOff(stop_alarm, rc=rc )
19681968
if (ChkErr(rc,__LINE__,u_FILE_u)) return
1969-
end if
1970-
end if
1969+
endif
1970+
endif
19711971

19721972
#ifndef CESMCOUPLED
19731973
call is_restart_fh(clock, restartfh_info, write_restartfh)
@@ -2071,12 +2071,12 @@ subroutine ModelAdvance(gcomp, rc)
20712071
enddo
20722072
endif
20732073

2074-
if(write_runtimelog) then
2074+
if (write_runtimelog) then
20752075
timere = MPI_Wtime()
2076-
if(is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', timere-timers
2076+
if (is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', timere-timers
20772077
endif
20782078

2079-
if(profile_memory) call ESMF_VMLogMemInfo("Leaving MOM Model_ADVANCE: ")
2079+
if (profile_memory) call ESMF_VMLogMemInfo("Leaving MOM Model_ADVANCE: ")
20802080

20812081
if (localPet == 0) call cap_profiling("mom", "ModelAdvance", "E")
20822082

@@ -2299,7 +2299,7 @@ subroutine ocean_model_finalize(gcomp, rc)
22992299
write(stdout,*) 'MOM: --- finalize called ---'
23002300
endif
23012301
rc = ESMF_SUCCESS
2302-
if(write_runtimelog) timefs = MPI_Wtime()
2302+
if (write_runtimelog) timefs = MPI_Wtime()
23032303

23042304
call ESMF_GridCompGetInternalState(gcomp, ocean_internalstate, rc)
23052305
if (ChkErr(rc,__LINE__,u_FILE_u)) return
@@ -2334,7 +2334,7 @@ subroutine ocean_model_finalize(gcomp, rc)
23342334
call outputlog_run(clock, .true., rc=rc)
23352335
if (ChkErr(rc,__LINE__,u_FILE_u)) return
23362336

2337-
if(write_runtimelog .and. is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', MPI_Wtime()-timefs
2337+
if (write_runtimelog .and. is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', MPI_Wtime()-timefs
23382338

23392339
if (localPet == 0) call cap_profiling("mom", "ocean_model_finalize", "E")
23402340

0 commit comments

Comments
 (0)