My Project
Functions/Subroutines | Variables
mod_input Module Reference

Functions/Subroutines

subroutine commandlineio (CVS_ID, CVS_Date, CVS_Name, CVS_Revision)
 
subroutine name_list_initialize
 
subroutine name_list_print
 
subroutine name_list_read
 
subroutine check_io_dirs
 
subroutine nullify_file_pointers
 
subroutine incriment_fname (FNAME)
 
subroutine open_startup_file
 
subroutine open_crashstart
 
subroutine search_for_last_matching_name (FNAME)
 
subroutine open_coldstart
 
subroutine open_new_output
 
subroutine open_forcing
 
subroutine load_horizontal_mixing_coefficient (NN, CC)
 
subroutine load_bottom_roughness (Z0)
 
subroutine load_grid_type (NCF, G)
 
subroutine load_restart_grid (NVG)
 
subroutine load_restart_obc_grid (IOBCN_GL, I_OBC_GL, TYPE_OBC_GL)
 
subroutine load_restart_lsf_grid (N_GL, I_GL, GEO_GL, WDF_GL)
 
subroutine load_restart_coords (X_LCL, Y_LCL)
 
subroutine load_restart_depth (H_LCL)
 
subroutine load_restart_coriolis (C_LCL)
 
subroutine load_restart_sponge (SPG)
 
subroutine load_restart_sigma (Z, Z1)
 
subroutine load_coldstart_grid (NVG)
 
subroutine load_coldstart_obc_grid (IOBCN_GL, I_OBC_GL, TYPE_OBC_GL)
 
subroutine load_coldstart_lsf (N_GL, I_GL, GEO_GL, WDF_GL)
 
subroutine load_coldstart_coords (X_GBL, Y_GBL, X_LCL, Y_LCL)
 
subroutine load_coldstart_depth (X_GBL, Y_GBL, H_LCL)
 
subroutine load_coldstart_coriolis (X_GBL, Y_GBL, C_LCL)
 
subroutine load_coldstart_sponge (X_GBL, Y_GBL, NSPONGE, N_SPG, R_SPG, C_SPG, X_SPG, Y_SPG)
 
subroutine load_coldstart_sigma
 
subroutine load_julian_obc (NTC, NAMES, PRD, EQ_AMP, EQ_BETA, EQ_TYPE, MPTD, PHS, RF, TORG)
 
subroutine read_julian_obc (JULOBCUNIT_TEMP, NTC, NAMES, PRD, EQ_AMP, EQ_BETA, EQ_TYPE, MPTD, PHS, RF, TORG)
 
subroutine parse_tide (line, cnt, ntc, data, ierr)
 
subroutine read_coldstart_grid (GRIDUNIT, MGL, NGL, NVG)
 
subroutine read_coldstart_obc_grid (OBCUNIT, MGL, IOBCN_GL, I_OBC_GL, TYPE_OBC_GL)
 
subroutine read_coldstart_lsf (LSFUNIT, N_GL, I_GL, GEO_GL, WDF_GL)
 
subroutine read_coldstart_coords (GRIDUNIT, MGL, XG2, YG2)
 
subroutine read_coldstart_depth (DEPTHUNIT, MGL, XG2, YG2, HG2)
 
subroutine read_coldstart_coriolis (CORIOLISUNIT, MGL, XG, YG, CORG)
 
subroutine read_coldstart_sponge (SPONGEUNIT, MGL, NSPONGE, N_SPG, R_SPG, C_SPG)
 
subroutine read_coldstart_sigma
 
subroutine helptxt (IPT)
 

Variables

type(ncfile), pointer nc_dat
 
type(ncfile), pointer nc_avg
 
type(ncfile), pointer nc_rst
 
type(ncfile), pointer nc_start
 

Function/Subroutine Documentation

◆ check_io_dirs()

subroutine mod_input::check_io_dirs ( )

Definition at line 884 of file mod_input.f90.

884  USE control
885  IMPLICIT NONE
886  integer :: ncfileind, datfileind,ios,charnum, i,ios2
887  logical :: fexist,back,connected
888  character(len=100) :: testchar
889  character(len=160) :: pathnfile
890  character(len=2) :: cios
891  ! CHECK FOR INPUT AND OUTPUT DIRECTORIES
892 
893 
894  ! Check for '/' at the end of directory strings
895 
896  back = .true.
897  charnum=index(trim(input_dir),"/",back)
898  if (charnum /= len_trim(input_dir)) then
899  input_dir=trim(input_dir)//"/"
900  if(dbg_set(dbg_io)) &
901  write(ipt,*) "Added '/' to input_dir: ",trim(input_dir)
902  end if
903 
904  charnum= index(trim(output_dir),"/",back)
905  if ( charnum /= len_trim(output_dir)) then
906  output_dir=trim(output_dir)//"/"
907  if(dbg_set(dbg_io)) &
908  write(ipt,*) "Added '/' to output_dir: ",trim(output_dir)
909  end if
910 
911  ! CHECK for Existance of output_dir and input_dir
912  if (msr) then
913  ! OUTPUT_DIR TEST FILE - must exist + Read/write permissions
914  testchar = trim(output_dir)//".fvcomtestfile"
915 
916  OPEN(unit=testunit,file=trim(testchar),&
917  & form="formatted",status="unknown",iostat=ios)
918  write(cios,'(i2.2)') ios
919  if (ios == 9) then
920  CALL fatal_error("Unable to OPEN the test file:",&
921  & trim(testchar), "IOSTAT ERROR#"//cios//"; suggests ba&
922  &d permissions in:", trim(output_dir))
923 
924  elseif (ios ==29) then
925  CALL fatal_error("Unable to OPEN the test file:",&
926  & trim(testchar), "IOSTAT ERROR#"//cios//"; suggests ba&
927  &d directory path:", trim(output_dir))
928 
929  else if (ios /= 0) then
930  CALL fatal_error("Unable to OPEN the test file:",&
931  & trim(testchar), "Unknown IOSTAT error# "//cios)
932  end if
933 
934  write(testunit,*)"This is a test file created by FVCOM. You may delete it."
935  write(testunit,*)"Have a nice day."
936 
937  CLOSE(unit=testunit,iostat=ios2)
938  if (ios2 /= 0) then
939  write(cios,'(i2.2)') ios2
940  CALL fatal_error("Unable to CLOSE the test file:",&
941  & trim(testchar), "Unknown IOSTAT error# "//cios)
942  end if
943 
944 
945  ! INPUT_DIR TEST FILE
946  testchar = trim(input_dir)//".fvcomtestfile"
947  OPEN(unit=testunit,file=trim(testchar),&
948  & form="formatted",status="unknown",iostat=ios)
949  write(cios,'(i2.2)') ios
950  if (ios == 9) then
951  CALL warning("Unable to OPEN the test file:",&
952  & trim(testchar), "IOSTAT ERROR#"//cios//"; suggests bad permissions&
953  & in:", trim(input_dir))
954  elseif (ios ==29) then
955  CALL warning("Unable to OPEN the test file:",&
956  & trim(testchar), "IOSTAT ERROR#"//cios//"; suggests ba&
957  &d directory path:",trim(input_dir))
958  else if (ios /= 0) then
959  CALL fatal_error("Unable to OPEN the test file:",&
960  & trim(testchar), "Unknown IOSTAT error# "//cios)
961 
962  else if (ios == 0) then
963  write(testunit,*)"This is a test file created by FVCOM. You may delete it."
964  write(testunit,*)"Have a nice day."
965  CLOSE(unit=testunit,iostat=ios2)
966  if (ios2 /= 0) then
967  write(cios,'(i2.2)') ios2
968  CALL fatal_error("Unable to CLOSE the test file:",&
969  & trim(testchar), "Unknown IOSTAT error# "//cios)
970  end if
971  end if
972 
973 
974  end if
975 
logical msr
Definition: mod_main.f90:101
character(len=80) output_dir
Definition: mod_main.f90:184
integer, parameter testunit
Definition: mod_main.f90:925
character(len=80) input_dir
Definition: mod_main.f90:183
integer ipt
Definition: mod_main.f90:922
integer ios
Definition: mod_obcs2.f90:81
Here is the caller graph for this function:

◆ commandlineio()

subroutine mod_input::commandlineio ( character(len=*), intent(in)  CVS_ID,
character(len=*), intent(in)  CVS_Date,
character(len=*), intent(in)  CVS_Name,
character(len=*), intent(in)  CVS_Revision 
)

Definition at line 66 of file mod_input.f90.

66  use mod_sng ! [mdl] String manipulatio
67  USE control
68 
69 
70  implicit none
71  ! Parameters
72  character(len=*), INTENT(IN)::CVS_Id ! [sng] CVS Identification
73  character(len=*), INTENT(IN)::CVS_Date ! [sng] Date string
74  character(len=*), INTENT(IN)::CVS_Name ! [sng] File name string
75  character(len=*), INTENT(IN)::CVS_Revision ! [sng] File revision string
76  character(len=*),parameter::nlc=char(0) ! [sng] NUL character = ASCII 0 = char(0)
77 
78  ! Command-line parsing
79  character(80)::arg_val ! [sng] command-line argument value
80  character(200)::cmd_ln ! [sng] command-line
81  character(80)::opt_sng ! [sng] Option string
82  character(2)::dsh_key ! [sng] command-line dash and switch
83  character(200)::prg_ID ! [sng] Program ID
84 
85  integer::arg_idx ! [idx] Counting index
86  integer::arg_nbr ! [nbr] Number of command-line arguments
87  integer::opt_lng ! [nbr] Length of option
88 
89  logical :: outtofile = .false.
90 
91  ! Initialize values from in variables
92  casename="empty"//nlc ! declared in mod_main - all_vars
93  dbg_lvl=0 ! declared in mod_dbg
94  infofile="screen"//nlc ! Get output file parameter
95  namelist_name = "empty"//nlc ! Name of blank name list file-
96  ! declared in mod_main
97 
98  ! Main code
99  call ftn_strini(cmd_ln) ! [sng] sng(1:len)=NUL
100 
101  call ftn_cmd_ln_sng(cmd_ln) ! [sng] Re-construct command-line into single string
102  call ftn_prg_id_mk(cvs_id,cvs_revision,cvs_date,prg_id) ! [sng] Program ID
103 
104  arg_nbr=command_argument_count() ! [nbr] Number of command-line arguments
105 
106  if (arg_nbr .LE. 0 ) then
107  if(msr) WRITE(ipt,*) "You must specify a case name: "
108  if(msr) Call helptxt(ipt)
109  call pshutdown
110  end if
111 
112  arg_idx=1 ! [idx] Counting index
113  do while (arg_idx <= arg_nbr)
114  call ftn_getarg_wrp(arg_idx,arg_val) ! [sbr] Call getarg, increment arg_idx
115  dsh_key=arg_val(1:2) ! [sng] First two characters of option
116  if (dsh_key == "--") then
117  opt_lng=ftn_opt_lng_get(arg_val) ! [nbr] Length of option
118  if (opt_lng <= 0) then
119  if(msr) write(ipt,*) "Long option has no name"
120  call pshutdown
121  end if
122 
123  opt_sng=arg_val(3:2+opt_lng) ! [sng] Option string
124  if (dbg_lvl >= dbg_io) then
125  if(msr) write (6,"(5a,i3)") prg_nm(1:ftn_strlen(prg_nm)), &
126  ": DEBUG Double hyphen indicates multi-character option: ", &
127  "opt_sng = ",opt_sng(1:ftn_strlen(opt_sng)),", opt_lng = ",opt_lng
128  end if
129  if (opt_sng == "dbg" .or. opt_sng == "dbg_lvl" ) then
130  call ftn_arg_get(arg_idx,arg_val,dbg_lvl) ! [enm] Debugging level
131 
132  else if (opt_sng == "dbg_par" .or.opt_sng == "Dbg_Par"&
133  & .or.opt_sng == "DBG_PAR") then
134 
135  dbg_par = .true.
136 
137  else if (opt_sng == "crashrestart" .or.opt_sng == "CrashRestart"&
138  & .or.opt_sng == "CRASHRESTART") then
139 
140  cmdln_restart = .true.
141  ! call ftn_arg_get(arg_idx,arg_val,dbg_par) ! [sng] Input file
142 
143  else if (opt_sng == "CaseName" .or.opt_sng == "casename"&
144  & .or.opt_sng == "CASENAME") then
145 
146  call ftn_arg_get(arg_idx,arg_val,casename) ! [sng] Input file
148  ! Convert back to a fortran string!
149 
150  else if (opt_sng == "Create_NameList" .or.opt_sng == "create_namelist"&
151  & .or.opt_sng == "CREATE_NAMELIST") then
152 
153  call ftn_arg_get(arg_idx,arg_val,namelist_name)
155 
156  blank_namelist = .true.
157 
158  else if (opt_sng == "LogFile" .or.opt_sng == "logfile"&
159  & .or.opt_sng == "LOGFILE") then
160 
161  call ftn_arg_get(arg_idx,arg_val,infofile)
163 
164  outtofile=.true.
165 
166  else if (opt_sng == "help" .or.opt_sng == "HELP" .or. opt_sng&
167  & == "Help") then
168 
169  if(msr) call helptxt(ipt)
170  call pshutdown
171 !!$ THIS DOES NOT SEEM PRACTICAL - MODIFY THE RUN FILE INSTEAD
172 !!$ else if (opt_sng == "CrashRestart") then
173 !!$ call ftn_arg_get(arg_idx,arg_val,CrashRestart) ! [lgc] Logical
174 
175  else ! Option not recognized
176  arg_idx=arg_idx-1 ! [idx] Counting index
177  if(msr) call ftn_getarg_err(arg_idx,arg_val) ! [sbr] Error handler for getarg()
178  endif ! endif option is recognized
179  ! Jump to top of while loop
180  cycle ! C, F77, and F90 use "continue", "goto", and "cycle"
181  endif ! endif long option
182 
183  if (dsh_key == "-V" .or.dsh_key == "-v" ) then
184 
185  if(msr) write(ipt,*) prg_id
186  call pshutdown
187 
188  else if (dsh_key == "-H" .or.dsh_key == "-h" ) then
189 
190  if(msr) Call helptxt(ipt)
191  Call pshutdown
192 
193  else ! Option not recognized
194  arg_idx=arg_idx-1 ! [idx] Counting index
195  if(msr) call ftn_getarg_err(arg_idx,arg_val) ! [sbr] Error handler for getarg()
196  endif ! endif arg_val
197 
198 
199  end do ! end while (arg_idx <= arg_nbr)
200 
201  if (blank_namelist) then
202  infofile =trim(namelist_name)//"_run.nml"
204  outtofile = .true.
205  end if
206 
207  CALL dbg_init(ipt_base,outtofile)
208 
209 
subroutine ftn_getarg_wrp(arg_idx, arg_val)
Definition: mod_sng.f90:159
character(len=80) casename
Definition: mod_main.f90:116
logical msr
Definition: mod_main.f90:101
subroutine ftn_getarg_err(arg_idx, arg_val)
Definition: mod_sng.f90:184
character(len=80) namelist_name
Definition: mod_main.f90:121
subroutine ftn_cmd_ln_sng(cmd_ln)
Definition: mod_sng.f90:1152
character(len=80) infofile
Definition: mod_main.f90:117
integer, parameter, public ipt_base
Definition: mod_main.f90:923
logical cmdln_restart
Definition: mod_main.f90:152
subroutine ftn_prg_id_mk(CVS_Id, CVS_Revision, CVS_Date, prg_ID)
Definition: mod_sng.f90:1079
integer function ftn_strlen(sng)
Definition: mod_sng.f90:98
integer function ftn_opt_lng_get(sng)
Definition: mod_sng.f90:118
subroutine helptxt(IPT)
Definition: mod_input.f90:3880
subroutine ftn_strini(sng)
Definition: mod_sng.f90:650
logical blank_namelist
Definition: mod_main.f90:120
integer ipt
Definition: mod_main.f90:922
Here is the call graph for this function:
Here is the caller graph for this function:

◆ helptxt()

subroutine mod_input::helptxt ( integer, intent(in)  IPT)

Definition at line 3880 of file mod_input.f90.

3880  implicit none
3881  INTEGER, INTENT(IN) :: IPT
3882  write(ipt,*) "Need to put something here!"
3883  write(ipt,*) "This is not a very helpful help message!"
3884  write(ipt,*) "LONG INPUT OPTIONS"
3885  write(ipt,*) "--HELP => PRINT THIS MESSAGE"
3886  write(ipt,*) "--CASENAME=<YOUR_CASE> (REQUIRED)"
3887  write(ipt,*) "--CREATE_NAMELIST => PRINT BLANK NAMELIST AND RETURN"
3888  write(ipt,*) "--LOGFILE=<FILENAME> => TO OUTPUT TO A LOG FILE"
3889  write(ipt,*) "--CRASHRESTART => RUN FROM CURRENT TIME IN RESTART FILE"
3890  write(ipt,*) "SHORT INPUT OPTIONS"
3891  write(ipt,*) "-V => PRINT FVCOM VERSION INFO AND RETURN"
3892  write(ipt,*) "-H => PRINT THIS MESSAGE AND RETURN"
3893  write(ipt,*) ""
3894  write(ipt,*) "DEBUG LEVELS"
3895  write(ipt,*) "--dbg=0 => DBG LOG (DEFAULT"
3896  write(ipt,*) "--dbg=1 => DBG IO FILENAMES"
3897  write(ipt,*) "--dbg=2 => DBG SCALARS"
3898  write(ipt,*) "--dbg=4 => DBG SUBROUTINE NAMES"
3899  write(ipt,*) "--dbg=5 => DBG SUBROUTINE IO"
3900  write(ipt,*) "--dbg=6 => DBG VECTORS"
3901  write(ipt,*) "--dbg=7 => DBG EVERYTHING"
3902  write(ipt,*) "--dbg_par => WRITE LOG FOR EACH PROCESSOR"
3903  write(ipt,*) ""
3904 
integer ipt
Definition: mod_main.f90:922
Here is the caller graph for this function:

◆ incriment_fname()

subroutine mod_input::incriment_fname ( character(len=160)  FNAME)

Definition at line 988 of file mod_input.f90.

988  IMPLICIT NONE
989  CHARACTER(LEN=160) FNAME
990  CHARACTER(LEN=4) NUMSTR
991  integer LENGTH,start,end,value
992  if(dbg_set(dbg_sbr)) &
993  & write(ipt,*) "STARTING INCRIMENT_FNAME"
994 
995  if(dbg_set(dbg_sbrio)) write(ipt,*) 'INCRIMENTING OLD FILE NAME: '//trim(fname)
996 
997  ! GET POSITION OF FILE NUMBER IN FNAME
998  length = len_trim(fname)
999  start = length - 6
1000  end = LENGTH - 3
1001 
1002  ! READ FILE NUMBER AND INCRIMENT BY ONE
1003  numstr=fname(start:end)
1004  read(numstr,*) value
1005  value = value + 1
1006  write(numstr,'(I4.4)') value
1007 
1008  ! INSERT BACK INTO FNAME
1009  fname(start:end) = numstr
1010 
1011  if(dbg_set(dbg_sbrio)) write(ipt,*) 'NEW FILE NAME: '//trim(fname)
1012 
1013  if(dbg_set(dbg_sbr)) &
1014  & write(ipt,*) "END INCRIMENT_FNAME"
1015 
character *20 function numstr(IVAL, RVAL, FORM)
Definition: swanser.f90:305
integer ipt
Definition: mod_main.f90:922
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_bottom_roughness()

subroutine mod_input::load_bottom_roughness ( real(sp), dimension(:), allocatable  Z0)

Definition at line 1747 of file mod_input.f90.

1747  USE control
1748  IMPLICIT NONE
1749  REAL(SP),ALLOCATABLE :: Z0(:)
1750  TYPE(NCFILE), POINTER :: NCF
1751  TYPE(NCVAR), POINTER :: VAR
1752  TYPE(NCDIM), POINTER :: DIM1
1753  TYPE(NCDIM), POINTER :: DIM2
1754  integer status,I,IERR
1755 
1756  LOGICAL FOUND
1757 
1758  ! FIND THE Bottom Roughness FILE OBJECT
1759  ncf => find_file(filehead,trim(bottom_roughness_file),found)
1760  IF(.not. found) CALL fatal_error &
1761  & ("COULD NOT FIND BOTTOM_ROUGHNESS_FILE FILE OBJECT",&
1762  & "FILE NAME: "//trim(bottom_roughness_file))
1763 
1764  dim1 => find_dim(ncf,'nele',found)
1765  IF(.not. found) CALL fatal_error &
1766  & ("COULD NOT FIND BOTTOM_ROUGHNESS_FILE DIMENSION 'nele' in:",&
1767  & "FILE NAME: "//trim(bottom_roughness_file))
1768  IF (dim1%DIM /= ngl)CALL fatal_error &
1769  & ("Dimension 'nele' in the BOTTOM_ROUGHNESS_FILE does not match NGL for this model?",&
1770  & "FILE NAME: "//trim(bottom_roughness_file))
1771 
1772 
1773  ! FIND THE 'z0B' variable
1774  var => find_var(ncf,'z0b',found)
1775  IF(.not. found) CALL fatal_error &
1776  & ("COULD NOT FIND BOTTOM_ROUGHNESS_FILE VARIABLE 'z0b' in:",&
1777  & "FILE NAME: "//trim(bottom_roughness_file))
1778 
1779  CALL nc_connect_avar(var,z0)
1780  CALL nc_read_var(var)
1781  CALL nc_disconnect(var)
1782 
1783 
character(len=80) bottom_roughness_file
Definition: mod_main.f90:370
integer ngl
Definition: mod_main.f90:49
Here is the caller graph for this function:

◆ load_coldstart_coords()

subroutine mod_input::load_coldstart_coords ( real(sp), dimension(:), allocatable  X_GBL,
real(sp), dimension(:), allocatable  Y_GBL,
real(sp), dimension(:), allocatable  X_LCL,
real(sp), dimension(:), allocatable  Y_LCL 
)

Definition at line 2444 of file mod_input.f90.

2444  USE control
2445  IMPLICIT NONE
2446  REAL(SP), ALLOCATABLE :: X_GBL(:),Y_GBL(:),X_LCL(:),Y_LCL(:)
2447  INTEGER :: SENDID
2448 
2449  integer status,I,IERR
2450 
2451  IF (msr) THEN
2453  CLOSE(gridunit)
2454  END IF
2455 
2456  IF (serial) THEN
2457  x_lcl = x_gbl
2458  y_lcl = y_gbl
2459 
2460  ! BROADCAST TO OTHER PROCS
2461  ELSE
2462  END IF
2463 
2464  ! DO NOT DEALLOCATE THE GLOBAL ARRAYS!
2465 
logical serial
Definition: mod_main.f90:100
integer, parameter gridunit
Definition: mod_main.f90:929
real(sp), dimension(:), allocatable, target x_gbl
Definition: mod_setup.f90:54
logical msr
Definition: mod_main.f90:101
subroutine read_coldstart_coords(GRIDUNIT, MGL, XG2, YG2)
Definition: mod_input.f90:3284
real(sp), dimension(:), allocatable, target x_lcl
Definition: mod_setup.f90:55
real(sp), dimension(:), allocatable, target y_lcl
Definition: mod_setup.f90:55
integer mgl
Definition: mod_main.f90:50
real(sp), dimension(:), allocatable, target y_gbl
Definition: mod_setup.f90:54
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_coldstart_coriolis()

subroutine mod_input::load_coldstart_coriolis ( real(sp), dimension(:), intent(in), allocatable  X_GBL,
real(sp), dimension(:), intent(in), allocatable  Y_GBL,
real(sp), dimension(:), allocatable  C_LCL 
)

Definition at line 2496 of file mod_input.f90.

2496  USE control
2497  IMPLICIT NONE
2498  integer :: SENDID
2499  REAL(SP), ALLOCATABLE :: C_LCL(:)
2500  REAL(SP), ALLOCATABLE, INTENT(IN) :: X_GBL(:),Y_GBL(:)
2501  REAL(SP), ALLOCATABLE :: C_GBL(:)
2502 
2503  ! WE ONLY USE A CORIOLIS FILE IF THE GRID FILE UNITS ARE METERS
2504  IF (msr) THEN
2505  ALLOCATE(c_gbl(0:mgl)); c_gbl= 0.0_sp
2506 
2507  IF (grid_file_units == 'degrees') THEN
2508  c_gbl = y_gbl
2509 
2510  ELSE IF (grid_file_units == 'meters') THEN
2511 
2513  CLOSE (coriolisunit)
2514  END IF
2515  END IF
2516 
2517  IF (serial) THEN
2518  c_lcl(0:mt) = c_gbl(0:mt)
2519 
2520  ELSE
2521  END IF
2522 
2523  IF(msr) DEALLOCATE(c_gbl)
2524 
logical serial
Definition: mod_main.f90:100
real(sp), dimension(:), allocatable, target x_gbl
Definition: mod_setup.f90:54
logical msr
Definition: mod_main.f90:101
integer mt
Definition: mod_main.f90:78
character(len=80) grid_file_units
Definition: mod_main.f90:626
real(sp), dimension(:), allocatable, target c_lcl
Definition: mod_setup.f90:58
integer mgl
Definition: mod_main.f90:50
real(sp), dimension(:), allocatable, target y_gbl
Definition: mod_setup.f90:54
integer, parameter coriolisunit
Definition: mod_main.f90:932
subroutine read_coldstart_coriolis(CORIOLISUNIT, MGL, XG, YG, CORG)
Definition: mod_input.f90:3437
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_coldstart_depth()

subroutine mod_input::load_coldstart_depth ( real(sp), dimension(:), intent(in), allocatable  X_GBL,
real(sp), dimension(:), intent(in), allocatable  Y_GBL,
real(sp), dimension(:), allocatable  H_LCL 
)

Definition at line 2469 of file mod_input.f90.

2469  USE control
2470  USE all_vars
2471  IMPLICIT NONE
2472  integer status,I,IERR
2473  REAL(SP), ALLOCATABLE :: H_LCL(:)
2474  REAL(SP), ALLOCATABLE, INTENT(IN) :: X_GBL(:),Y_GBL(:)
2475 ! REAL(SP), ALLOCATABLE :: HG(:)
2476  INTEGER :: SENDID,SENDER
2477 
2478  IF (msr) THEN
2479  ALLOCATE(hg(0:mgl)); hg=0.0_sp
2481  CLOSE(depthunit)
2482  END IF
2483 
2484 
2485  IF (serial) THEN
2486  h_lcl(0:mgl) = hg(0:mgl)
2487 
2488  ELSE
2489  END IF
2490 
2491 ! IF(MSR) DEALLOCATE(HG)
2492 
logical serial
Definition: mod_main.f90:100
real(sp), dimension(:), allocatable, target x_gbl
Definition: mod_setup.f90:54
logical msr
Definition: mod_main.f90:101
real(sp), dimension(:), allocatable, target h_lcl
Definition: mod_setup.f90:61
integer, parameter depthunit
Definition: mod_main.f90:931
integer mgl
Definition: mod_main.f90:50
real(sp), dimension(:), allocatable, target y_gbl
Definition: mod_setup.f90:54
real(sp), dimension(:), allocatable hg
Definition: mod_main.f90:977
subroutine read_coldstart_depth(DEPTHUNIT, MGL, XG2, YG2, HG2)
Definition: mod_input.f90:3329
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_coldstart_grid()

subroutine mod_input::load_coldstart_grid ( integer, dimension(:,:), intent(out), allocatable  NVG)

Definition at line 2373 of file mod_input.f90.

2373  USE control
2374  IMPLICIT NONE
2375  INTEGER, ALLOCATABLE, INTENT(OUT) :: NVG(:,:)
2376  integer :: status,I,IERR, SENDER, nvals
2377 
2378  IF(msr) THEN
2380  ! DO NOT CLOSE THE GRID FILE HERE
2381  ! READ THE COORDS FIRST
2382  END IF
2383 
2384  ! BROADCAST TO OTHER PROCS
2385  IF(par) THEN
2386  END IF
2387 
integer, parameter gridunit
Definition: mod_main.f90:929
logical msr
Definition: mod_main.f90:101
logical par
Definition: mod_main.f90:102
integer, dimension(:,:), allocatable nvg
Definition: mod_main.f90:969
integer mgl
Definition: mod_main.f90:50
subroutine read_coldstart_grid(GRIDUNIT, MGL, NGL, NVG)
Definition: mod_input.f90:2980
integer ngl
Definition: mod_main.f90:49
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_coldstart_lsf()

subroutine mod_input::load_coldstart_lsf ( integer, intent(out)  N_GL,
integer, dimension(:), intent(out), allocatable  I_GL,
real(sp), dimension(:), intent(out), allocatable  GEO_GL,
real(sp), dimension(:), intent(out), allocatable  WDF_GL 
)

Definition at line 2417 of file mod_input.f90.

2417  USE control
2418  IMPLICIT NONE
2419  INTEGER, INTENT(OUT) :: N_GL
2420  INTEGER, INTENT(OUT), Allocatable :: I_GL(:)
2421  REAL(SP), INTENT(OUT), Allocatable :: GEO_GL(:),WDF_GL(:)
2422  INTEGER :: IERR, SENDER
2423 
2424  IF(.NOT. obc_longshore_flow_on) THEN
2425  if(dbg_set(dbg_log)) then
2426  WRITE(ipt,*)'! OPEN BOUNDARY LONGSHORE FLOW IS OFF '
2427  WRITE(ipt,*)'!'
2428  end if
2429  RETURN
2430  END IF
2431 
2432  IF(msr) THEN
2433  CALL read_coldstart_lsf(lsfunit,n_gl,i_gl, geo_gl,wdf_gl)
2434  CLOSE(obcunit)
2435  END IF
2436 
2437  IF(par) THEN
2438  END IF
2439 
logical msr
Definition: mod_main.f90:101
logical par
Definition: mod_main.f90:102
logical obc_longshore_flow_on
Definition: mod_main.f90:598
subroutine read_coldstart_lsf(LSFUNIT, N_GL, I_GL, GEO_GL, WDF_GL)
Definition: mod_input.f90:3194
integer, parameter obcunit
Definition: mod_main.f90:928
integer ipt
Definition: mod_main.f90:922
integer, parameter lsfunit
Definition: mod_main.f90:934
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_coldstart_obc_grid()

subroutine mod_input::load_coldstart_obc_grid ( integer, intent(out)  IOBCN_GL,
integer, dimension(:), intent(out), allocatable  I_OBC_GL,
integer, dimension(:), intent(out), allocatable  TYPE_OBC_GL 
)

Definition at line 2392 of file mod_input.f90.

2392  USE control
2393  IMPLICIT NONE
2394  INTEGER, INTENT(OUT) :: IOBCN_GL
2395  INTEGER, INTENT(OUT), Allocatable :: I_OBC_GL(:), TYPE_OBC_GL(:)
2396  INTEGER :: IERR, SENDER
2397 
2398  IF(.NOT. obc_on) THEN
2399  if(dbg_set(dbg_log)) then
2400  WRITE(ipt,*)'! OBC IS OFF '
2401  WRITE(ipt,*)'!'
2402  end if
2403  RETURN
2404  END IF
2405 
2406  IF(msr) THEN
2408  CLOSE(obcunit)
2409  END IF
2410 
2411  IF(par) THEN
2412  END IF
2413 
logical msr
Definition: mod_main.f90:101
logical obc_on
Definition: mod_main.f90:585
logical par
Definition: mod_main.f90:102
integer, dimension(:), allocatable i_obc_gl
Definition: mod_main.f90:1773
integer mgl
Definition: mod_main.f90:50
integer, dimension(:), allocatable type_obc_gl
Definition: mod_main.f90:1782
integer, parameter obcunit
Definition: mod_main.f90:928
integer iobcn_gl
Definition: mod_main.f90:1775
integer ipt
Definition: mod_main.f90:922
subroutine read_coldstart_obc_grid(OBCUNIT, MGL, IOBCN_GL, I_OBC_GL, TYPE_OBC_GL)
Definition: mod_input.f90:3093
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_coldstart_sigma()

subroutine mod_input::load_coldstart_sigma ( )

Definition at line 2558 of file mod_input.f90.

2558  USE control
2559  IMPLICIT NONE
2560  INTEGER :: STYPE_LEN, IERR, SENDER, STATUS
2561 
2562  stype=""
2563 
2564  IF (msr) THEN
2566  CLOSE(sigmaunit)
2567  END IF
2568 
2569 
2570 
2571  kbm1 = kb -1
2572  kbm2 = kb -2
2573 
2574 
logical msr
Definition: mod_main.f90:101
integer kb
Definition: mod_main.f90:64
integer kbm2
Definition: mod_main.f90:66
integer, parameter sigmaunit
Definition: mod_main.f90:930
subroutine read_coldstart_sigma
Definition: mod_input.f90:3639
integer kbm1
Definition: mod_main.f90:65
character(len=80) stype
Definition: mod_main.f90:893
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_coldstart_sponge()

subroutine mod_input::load_coldstart_sponge ( real(sp), dimension(:), intent(in), allocatable  X_GBL,
real(sp), dimension(:), intent(in), allocatable  Y_GBL,
integer, intent(out)  NSPONGE,
integer, dimension(:), intent(out), allocatable  N_SPG,
real(sp), dimension(:), intent(out), allocatable  R_SPG,
real(sp), dimension(:), intent(out), allocatable  C_SPG,
real(sp), dimension(:), intent(out), allocatable  X_SPG,
real(sp), dimension(:), intent(out), allocatable  Y_SPG 
)

Definition at line 2528 of file mod_input.f90.

2528  USE control
2529  IMPLICIT NONE
2530  REAL(SP), ALLOCATABLE, INTENT(IN) :: X_GBL(:),Y_GBL(:)
2531  INTEGER, INTENT(OUT) :: NSPONGE
2532  INTEGER, ALLOCATABLE, INTENT(OUT) :: N_SPG(:)
2533  REAL(SP), ALLOCATABLE, INTENT(OUT):: R_SPG(:),C_SPG(:),X_SPG(:),Y_SPG(:)
2534  INTEGER :: SENDER,IERR
2535 
2536  IF(msr) THEN
2538  CLOSE(spongeunit)
2539  END IF
2540 
2541 
2542 
2543  IF(nsponge == 0) RETURN
2544 
2545  ALLOCATE(x_spg(nsponge)); x_spg = 0.0
2546  ALLOCATE(y_spg(nsponge)); y_spg = 0.0
2547 
2548  IF(msr) THEN
2549  x_spg= x_gbl(n_spg)
2550  y_spg= y_gbl(n_spg)
2551  END IF
2552 
2553 
2554 
real(sp), dimension(:), allocatable, target x_gbl
Definition: mod_setup.f90:54
logical msr
Definition: mod_main.f90:101
integer nsponge
Definition: mod_setup.f90:66
real(sp), dimension(:), allocatable, target c_spg
Definition: mod_setup.f90:65
real(sp), dimension(:), allocatable, target r_spg
Definition: mod_setup.f90:65
real(sp), dimension(:), allocatable, target y_spg
Definition: mod_setup.f90:65
real(sp), dimension(:), allocatable, target x_spg
Definition: mod_setup.f90:65
integer, parameter spongeunit
Definition: mod_main.f90:933
integer, dimension(:), allocatable, target n_spg
Definition: mod_setup.f90:64
integer mgl
Definition: mod_main.f90:50
real(sp), dimension(:), allocatable, target y_gbl
Definition: mod_setup.f90:54
subroutine read_coldstart_sponge(SPONGEUNIT, MGL, NSPONGE, N_SPG, R_SPG, C_SPG)
Definition: mod_input.f90:3539
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_grid_type()

subroutine mod_input::load_grid_type ( type(ncfile), pointer  NCF,
type(grid), pointer  G 
)

Definition at line 1789 of file mod_input.f90.

1789  IMPLICIT NONE
1790 
1791  TYPE(NCFILE), POINTER :: NCF
1792  TYPE(GRID), POINTER :: G
1793 
1794 
1795  TYPE(NCVAR), POINTER :: VAR
1796  TYPE(NCDIM), POINTER :: DIM1
1797  TYPE(NCDIM), POINTER :: DIM2
1798  integer status,I,IERR
1799 
1800  LOGICAL FOUND
1801 
1802  !==============================================================================|
1803 
1804 
1805  ! GET GLOBAL DIMENSION!
1806  dim1 => find_dim(ncf,"node",found)
1807  IF(.not. found) CALL fatal_error&
1808  &("COULD NOT FIND DIMENSION 'node' IN THE FILE OBJECT:"//trim(ncf%FNAME))
1809 
1810  IF(g%MGL==0) THEN
1811  g%MGL = dim1%DIM
1812  ELSEIF(g%MGL/= dim1%DIM)THEN
1813  CALL fatal_error &
1814  &("THE GRID TYPE DIMENSION MGL DOES NOT MATCH THE FILE DIMENSION:"//trim(ncf%FNAME))
1815  END IF
1816 
1817  dim1 => find_dim(ncf,"nele",found)
1818  IF(.not. found) CALL fatal_error&
1819  &("COULD NOT FIND DIMENSION 'nele' IN THE FILE OBJECT:"//trim(ncf%FNAME))
1820 
1821  IF(g%NGL==0) THEN
1822  g%NGL = dim1%DIM
1823  ELSEIF(g%NGL/= dim1%DIM)THEN
1824  CALL fatal_error &
1825  &("THE GRID TYPE DIMENSION NGL DOES NOT MATCH THE FILE DIMENSION:"//trim(ncf%FNAME))
1826  END IF
1827 
1828  IF(g%MT == 0) g%MT = g%MGL
1829  IF(g%NT == 0) g%NT = g%NGL
1830 
1831 
1832  ! CHECK TO MAKE SURE DIMENSION THREE IS THERE
1833  dim1 => find_dim(ncf,"three",found)
1834  IF(.not. found) CALL fatal_error&
1835  &("COULD NOT FIND DIMENSION 'three' IN THE FILE OBJECT:"//trim(ncf%FNAME))
1836 
1837  IF(dim1%DIM /=3) CALL fatal_error&
1838  &("DIMENSION 'three' IS NOT 3 IN THE FILE OBJECT:"//trim(ncf%FNAME))
1839 
1840 
1841  ! SIGLEV/Z
1842  dim1 => find_dim(ncf,"siglev",found)
1843  IF(.not. found) CALL fatal_error&
1844  &("COULD NOT FIND DIMENSION 'siglev' IN THE FILE OBJECT:"//trim(ncf%FNAME))
1845 
1846  IF(g%KB==0) THEN
1847  g%KB = dim1%DIM
1848  ELSEIF(g%KB/= dim1%DIM)THEN
1849  CALL fatal_error &
1850  &("THE GRID TYPE DIMENSION KB DOES NOT MATCH THE FILE DIMENSION:"//trim(ncf%FNAME))
1851  END IF
1852 
1853 
1854  !SIGLAY/ZZ
1855  dim1 => find_dim(ncf,"siglay",found)
1856  IF(.not. found) CALL fatal_error&
1857  &("COULD NOT FIND DIMENSION 'siglay' IN THE FILE OBJECT:"//trim(ncf%FNAME))
1858 
1859  g%KBM1 = dim1%DIM
1860  IF(g%KBM1 /= g%KB -1) CALL fatal_error&
1861  &("KB and KBM1 DO NOT MATCH IN THE FILE:"//trim(ncf%FNAME))
1862 
1863  g%KBM2 = g%KB - 2
1864 
1865 
1866  IF(.NOT. ioproc)THEN
1867 
1868  ! READ THE GRID DATA
1869  ALLOCATE(g%NV(0:g%NGL,4),stat=status)
1870  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE G%NV WHILE READING:"//trim(ncf%FNAME))
1871  g%nv=0
1872 
1873  var => find_var(ncf,'nv',found)
1874  IF(.not. found) CALL fatal_error&
1875  &("COULD NOT FIND VARIABLE 'nv' IN THE FILE OBJECT:"//trim(ncf%FNAME))
1876 
1877  var%ARR_INT => g%nv(1:g%NGL,1:3)
1878  CALL nc_read_var(var)
1879  CALL nc_disconnect(var)
1880 
1881  g%NV(:,4)=g%NV(:,1)
1882 
1883 
1884  ! READ THE COORDINATES
1885  ! X - meters
1886  ALLOCATE(g%XM(0:g%MT),stat=status)
1887  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE G%XM WHILE READING:"//trim(ncf%FNAME))
1888  g%XM=0.0_sp
1889 
1890  var => find_var(ncf,'x',found)
1891  IF(.not. found) CALL fatal_error&
1892  &("COULD NOT FIND VARIABLE 'x' IN THE FILE OBJECT:"//trim(ncf%FNAME))
1893 
1894  CALL nc_connect_pvar(var,g%XM)
1895  CALL nc_read_var(var)
1896  CALL nc_disconnect(var)
1897 
1898  ! Y - meters
1899  ALLOCATE(g%YM(0:g%MT),stat=status)
1900  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE G%YM WHILE READING:"//trim(ncf%FNAME))
1901  g%YM=0.0_sp
1902 
1903  var => find_var(ncf,'y',found)
1904  IF(.not. found) CALL fatal_error&
1905  &("COULD NOT FIND VARIABLE 'y' IN THE FILE OBJECT:"//trim(ncf%FNAME))
1906 
1907  CALL nc_connect_pvar(var,g%YM)
1908  CALL nc_read_var(var)
1909  CALL nc_disconnect(var)
1910 
1911  ! X element - meters
1912  ALLOCATE(g%XMC(0:g%NT),stat=status)
1913  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE G%XMC WHILE READING:"//trim(ncf%FNAME))
1914  g%XMC=0.0_sp
1915 
1916  var => find_var(ncf,'xc',found)
1917  IF(.not. found) CALL fatal_error&
1918  &("COULD NOT FIND VARIABLE 'xc' IN THE FILE OBJECT:"//trim(ncf%FNAME))
1919 
1920  CALL nc_connect_pvar(var,g%XMC)
1921  CALL nc_read_var(var)
1922  CALL nc_disconnect(var)
1923 
1924  ! Y element - meters
1925  ALLOCATE(g%YMC(0:g%NT),stat=status)
1926  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE G%YMC WHILE READING:"//trim(ncf%FNAME))
1927  g%YMC=0.0_sp
1928 
1929  var => find_var(ncf,'yc',found)
1930  IF(.not. found) CALL fatal_error&
1931  &("COULD NOT FIND VARIABLE 'yc' IN THE FILE OBJECT:"//trim(ncf%FNAME))
1932 
1933  CALL nc_connect_pvar(var,g%YMC)
1934  CALL nc_read_var(var)
1935  CALL nc_disconnect(var)
1936 
1937 
1938  ! Longitude
1939  ALLOCATE(g%LON(0:g%MT),stat=status)
1940  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE G%LON WHILE READING:"//trim(ncf%FNAME))
1941  g%LON=0.0_sp
1942 
1943  var => find_var(ncf,'lon',found)
1944  IF(.not. found) CALL fatal_error&
1945  &("COULD NOT FIND VARIABLE 'lon' IN THE FILE OBJECT:"//trim(ncf%FNAME))
1946 
1947  CALL nc_connect_pvar(var,g%LON)
1948  CALL nc_read_var(var)
1949  CALL nc_disconnect(var)
1950 
1951  ! Latitude
1952  ALLOCATE(g%LAT(0:g%MT),stat=status)
1953  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE G%LAT WHILE READING:"//trim(ncf%FNAME))
1954  g%LAT=0.0_sp
1955 
1956  var => find_var(ncf,'lat',found)
1957  IF(.not. found) CALL fatal_error&
1958  &("COULD NOT FIND VARIABLE 'lat' IN THE FILE OBJECT:"//trim(ncf%FNAME))
1959 
1960  CALL nc_connect_pvar(var,g%LAT)
1961  CALL nc_read_var(var)
1962  CALL nc_disconnect(var)
1963 
1964  ! Longitude - element
1965  ALLOCATE(g%LONC(0:g%NT),stat=status)
1966  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE G%LONC WHILE READING:"//trim(ncf%FNAME))
1967  g%LONC=0.0_sp
1968 
1969  var => find_var(ncf,'lonc',found)
1970  IF(.not. found) CALL fatal_error&
1971  &("COULD NOT FIND VARIABLE 'lonc' IN THE FILE OBJECT:"//trim(ncf%FNAME))
1972 
1973  CALL nc_connect_pvar(var,g%LONC)
1974  CALL nc_read_var(var)
1975  CALL nc_disconnect(var)
1976 
1977  ! Latitude - element
1978  ALLOCATE(g%LATC(0:g%NT),stat=status)
1979  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE G%LATC WHILE READING:"//trim(ncf%FNAME))
1980  g%LATC=0.0_sp
1981 
1982  var => find_var(ncf,'latc',found)
1983  IF(.not. found) CALL fatal_error&
1984  &("COULD NOT FIND VARIABLE 'latc' IN THE FILE OBJECT:"//trim(ncf%FNAME))
1985 
1986  CALL nc_connect_pvar(var,g%LATC)
1987  CALL nc_read_var(var)
1988  CALL nc_disconnect(var)
1989 
1990 
1991  ! h
1992  ALLOCATE(g%H(0:g%MT),stat=status)
1993  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE G%H WHILE READING:"//trim(ncf%FNAME))
1994  g%H=0.0_sp
1995 
1996  var => find_var(ncf,'h',found)
1997  IF(.not. found) CALL fatal_error&
1998  &("COULD NOT FIND VARIABLE 'h' IN THE FILE OBJECT:"//trim(ncf%FNAME))
1999 
2000  CALL nc_connect_pvar(var,g%H)
2001  CALL nc_read_var(var)
2002  CALL nc_disconnect(var)
2003 
2004  ! h1
2005  ALLOCATE(g%H1(0:g%NT),stat=status)
2006  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE G%H1 WHILE READING:"//trim(ncf%FNAME))
2007  g%H1=0.0_sp
2008 
2009  var => find_var(ncf,'h_center',found)
2010  IF(.not. found) CALL fatal_error&
2011  &("COULD NOT FIND VARIABLE 'h_center' IN THE FILE OBJECT:"//trim(ncf%FNAME))
2012 
2013  CALL nc_connect_pvar(var,g%H1)
2014  CALL nc_read_var(var)
2015  CALL nc_disconnect(var)
2016 
2017  ! zz
2018  ALLOCATE(g%ZZ(0:g%MT,g%KBM1),stat=status)
2019  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE G%ZZ WHILE READING:"//trim(ncf%FNAME))
2020  g%ZZ=0.0_sp
2021 
2022  var => find_var(ncf,'siglay',found)
2023  IF(.not. found) CALL fatal_error&
2024  &("COULD NOT FIND VARIABLE 'siglay' IN THE FILE OBJECT:"//trim(ncf%FNAME))
2025 
2026  CALL nc_connect_pvar(var,g%ZZ)
2027  CALL nc_read_var(var)
2028  CALL nc_disconnect(var)
2029 
2030  ! zz1
2031  ALLOCATE(g%ZZ1(0:g%NT,g%KBM1),stat=status)
2032  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE G%ZZ1 WHILE READING:"//trim(ncf%FNAME))
2033  g%ZZ1=0.0_sp
2034 
2035  var => find_var(ncf,'siglay_center',found)
2036  IF(.not. found) CALL fatal_error&
2037  &("COULD NOT FIND VARIABLE 'siglay_center' IN THE FILE OBJECT:"//trim(ncf%FNAME))
2038 
2039  CALL nc_connect_pvar(var,g%ZZ1)
2040  CALL nc_read_var(var)
2041  CALL nc_disconnect(var)
2042 
2043  END IF
2044 
2045 
2046 
logical ioproc
Definition: mod_main.f90:103

◆ load_horizontal_mixing_coefficient()

subroutine mod_input::load_horizontal_mixing_coefficient ( real(sp), dimension(:), allocatable  NN,
real(sp), dimension(:), allocatable  CC 
)

Definition at line 1690 of file mod_input.f90.

1690  USE control
1691  IMPLICIT NONE
1692  REAL(SP),ALLOCATABLE :: NN(:),CC(:)
1693  TYPE(NCFILE), POINTER :: NCF
1694  TYPE(NCVAR), POINTER :: VAR
1695  TYPE(NCDIM), POINTER :: DIM1
1696  TYPE(NCDIM), POINTER :: DIM2
1697  integer status,I,IERR
1698 
1699  LOGICAL FOUND
1700 
1701  ! FIND THE HVC FILE OBJECT
1702  ncf => find_file(filehead,trim(horizontal_mixing_file),found)
1703  IF(.not. found) CALL fatal_error &
1704  & ("COULD NOT FIND HORIZONTAL_MIXING_FILE FILE OBJECT",&
1705  & "FILE NAME: "//trim(horizontal_mixing_file))
1706 
1707  dim1 => find_dim(ncf,'nele',found)
1708  IF(.not. found) CALL fatal_error &
1709  & ("COULD NOT FIND HORIZONTAL_MIXING_FILE DIMENSION 'nele' in:",&
1710  & "FILE NAME: "//trim(horizontal_mixing_file))
1711  IF (dim1%DIM /= ngl)CALL fatal_error &
1712  & ("Dimension 'nele' in the HORIZONTAL_MIXING_FILE does not match NGL for this model?",&
1713  & "FILE NAME: "//trim(horizontal_mixing_file))
1714 
1715  dim2 => find_dim(ncf,'node',found)
1716  IF(.not. found) CALL fatal_error &
1717  & ("COULD NOT FIND HORIZONTAL_MIXING_FILE DIMENSION 'node' in:",&
1718  & "FILE NAME: "//trim(horizontal_mixing_file))
1719  IF (dim2%DIM /= mgl)CALL fatal_error &
1720  & ("Dimension 'node' in the HORIZONTAL_MIXING_FILE does not match MGL for this model?",&
1721  & "FILE NAME: "//trim(horizontal_mixing_file))
1722 
1723  ! FIND THE 'nn_hvc' variable
1724  var => find_var(ncf,'nn_hvc',found)
1725  IF(.not. found) CALL fatal_error &
1726  & ("COULD NOT FIND HORIZONTAL_MIXING_FILE VARIABLE 'nn_hvc' in:",&
1727  & "FILE NAME: "//trim(horizontal_mixing_file))
1728 
1729  CALL nc_connect_avar(var,nn)
1730  CALL nc_read_var(var)
1731  CALL nc_disconnect(var)
1732 
1733  ! FIND THE 'cc_hvc' variable
1734  var => find_var(ncf,'cc_hvc',found)
1735  IF(.not. found) CALL fatal_error &
1736  & ("COULD NOT FIND HORIZONTAL_MIXING_FILE VARIABLE 'cc_hvc' in:",&
1737  & "FILE NAME: "//trim(horizontal_mixing_file))
1738 
1739  CALL nc_connect_avar(var,cc)
1740  CALL nc_read_var(var)
1741  CALL nc_disconnect(var)
1742 
1743 
integer mgl
Definition: mod_main.f90:50
character(len=80) horizontal_mixing_file
Definition: mod_main.f90:352
integer ngl
Definition: mod_main.f90:49
Here is the caller graph for this function:

◆ load_julian_obc()

subroutine mod_input::load_julian_obc ( integer, intent(out)  NTC,
character(len=*), dimension(:), allocatable  NAMES,
real(sp), dimension(:), intent(out), allocatable  PRD,
real(sp), dimension(:), intent(out), allocatable  EQ_AMP,
real(sp), dimension(:), intent(out), allocatable  EQ_BETA,
character(len=*), dimension(:), allocatable  EQ_TYPE,
real(sp), dimension(:,:), intent(out), allocatable  MPTD,
real(sp), dimension(:,:), intent(out), allocatable  PHS,
real(sp), dimension(:), intent(out), allocatable  RF,
type(time), intent(out)  TORG 
)

Definition at line 2580 of file mod_input.f90.

2580  USE control
2581  USE bcs
2582  IMPLICIT NONE
2583  INTEGER,INTENT(OUT) :: NTC ! Number of Tidal Components
2584  REAL(SP),INTENT(OUT), ALLOCATABLE :: PRD(:) ! Tidal Period
2585  REAL(SP),INTENT(OUT), ALLOCATABLE :: EQ_AMP(:) ! Tidal Period
2586  REAL(SP),INTENT(OUT), ALLOCATABLE :: EQ_BETA(:) ! Tidal Period
2587  CHARACTER(LEN=*),ALLOCATABLE :: EQ_TYPE(:) ! Name of Components
2588 
2589  REAL(SP),INTENT(OUT), ALLOCATABLE :: MPTD(:,:) ! Amplitude
2590  REAL(SP),INTENT(OUT), ALLOCATABLE :: PHS(:,:)! Phase
2591  REAL(SP),INTENT(OUT), ALLOCATABLE :: RF(:) ! Reference Height
2592  CHARACTER(LEN=*), ALLOCATABLE :: Names(:) ! Name of Components
2593  TYPE(TIME),INTENT(OUT) :: TORG
2594 
2595 
2596  REAL(SP), ALLOCATABLE :: MPTD_GL(:,:) ! Amplitude
2597  REAL(SP), ALLOCATABLE :: PHS_GL(:,:)! Phase
2598  REAL(SP), ALLOCATABLE :: RF_GL(:) ! Reference Height
2599 
2600  INTEGER :: CHAR_LEN,IERR, SENDER, STATUS, I
2601 
2602  IF(serial) THEN
2603  CALL read_julian_obc(julobcunit,ntc,names,prd,eq_amp,eq_beta&
2604  &,eq_type,mptd,phs,rf,torg)
2605  CLOSE(julobcunit)
2606 
2607  IF(obc_elevation_forcing_on .and. SIZE(rf) /= iobcn_gl) CALL fatal_error&
2608  &("LOAD_JULIAN_OBC: THE NUMBER OF OBC NODES DOES NOT MATCH",&
2609  & "THE NON JULIAN ASCII FORCING FILE")
2610 
2611  END IF
2612 
2613 
2614 
2615 
logical serial
Definition: mod_main.f90:100
integer, parameter julobcunit
Definition: mod_main.f90:938
logical obc_elevation_forcing_on
Definition: mod_main.f90:587
integer iobcn_gl
Definition: mod_main.f90:1775
subroutine read_julian_obc(JULOBCUNIT_TEMP, NTC, NAMES, PRD, EQ_AMP, EQ_BETA, EQ_TYPE, MPTD, PHS, RF, TORG)
Definition: mod_input.f90:2621
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_restart_coords()

subroutine mod_input::load_restart_coords ( real(sp), dimension(:), allocatable, target  X_LCL,
real(sp), dimension(:), allocatable, target  Y_LCL 
)

Definition at line 2246 of file mod_input.f90.

2246  USE control
2247  IMPLICIT NONE
2248  REAL(SP), ALLOCATABLE,TARGET :: X_LCL(:),Y_LCL(:)
2249 
2250  TYPE(NCVAR), POINTER :: VAR
2251  INTEGER STATUS
2252  LOGICAL FOUND
2253 
2254  ! NEED LOGIC TO DECIDE WHICH TO LOAD LAT/LON or X/Y
2255  SELECT CASE(grid_file_units)
2256 
2257  CASE('meters')
2258  ! CONNECT THE VARIABLE OBJECTS AND LOAD THE DATA
2259  var => find_var(nc_start,'x',found)
2260  IF(.not. found) CALL fatal_error("COULD NOT FIND VARIABLE 'x'&
2261  & IN THE HOTSTART FILE OBJECT")
2262  CALL nc_connect_avar(var, x_lcl)
2263  CALL nc_read_var(var)
2264  CALL nc_disconnect(var)
2265 
2266 
2267  var => find_var(nc_start,'y',found)
2268  IF(.not. found) CALL fatal_error("COULD NOT FIND VARIABLE 'y'&
2269  & IN THE HOTSTART FILE OBJECT")
2270  CALL nc_connect_avar(var, y_lcl)
2271  CALL nc_read_var(var)
2272  CALL nc_disconnect(var)
2273 
2274  CASE('degrees')
2275  ! CONNECT THE VARIABLE OBJECTS AND LOAD THE DATA
2276  var => find_var(nc_start,'lon',found)
2277  IF(.not. found) CALL fatal_error("COULD NOT FIND VARIABLE 'lon'&
2278  & IN THE HOTSTART FILE OBJECT")
2279  CALL nc_connect_avar(var, x_lcl)
2280  CALL nc_read_var(var)
2281  CALL nc_disconnect(var)
2282 
2283 
2284  var => find_var(nc_start,'lat',found)
2285  IF(.not. found) CALL fatal_error("COULD NOT FIND VARIABLE 'lat'&
2286  & IN THE HOTSTART FILE OBJECT")
2287 
2288  CALL nc_connect_avar(var, y_lcl)
2289  CALL nc_read_var(var)
2290  CALL nc_disconnect(var)
2291 
2292  CASE DEFAULT
2293 
2294  CALL fatal_error("UNKNOWN GRID_FILE_UNITS: "//trim(grid_file_units))
2295 
2296  END SELECT
2297 
real(sp), dimension(:), allocatable, target x_lcl
Definition: mod_setup.f90:55
character(len=80) grid_file_units
Definition: mod_main.f90:626
real(sp), dimension(:), allocatable, target y_lcl
Definition: mod_setup.f90:55
type(ncfile), pointer nc_start
Definition: mod_input.f90:51
Here is the caller graph for this function:

◆ load_restart_coriolis()

subroutine mod_input::load_restart_coriolis ( real(sp), dimension(:), allocatable, target  C_LCL)

Definition at line 2318 of file mod_input.f90.

2318  IMPLICIT NONE
2319  REAL(SP), ALLOCATABLE, TARGET:: C_LCL(:)
2320  TYPE(NCVAR), POINTER :: VAR
2321  INTEGER STATUS
2322  LOGICAL FOUND
2323 
2324  var => find_var(nc_start,'cor',found)
2325  IF(.not. found) CALL fatal_error("COULD NOT FIND VARIABLE 'cor'&
2326  & IN THE HOTSTART FILE OBJECT")
2327  CALL nc_connect_avar(var, c_lcl)
2328  CALL nc_read_var(var)
2329  CALL nc_disconnect(var)
2330 
real(sp), dimension(:), allocatable, target c_lcl
Definition: mod_setup.f90:58
type(ncfile), pointer nc_start
Definition: mod_input.f90:51
Here is the caller graph for this function:

◆ load_restart_depth()

subroutine mod_input::load_restart_depth ( real(sp), dimension(:), allocatable, target  H_LCL)

Definition at line 2302 of file mod_input.f90.

2302  IMPLICIT NONE
2303  REAL(SP), ALLOCATABLE, TARGET:: H_LCL(:)
2304  TYPE(NCVAR), POINTER :: VAR
2305  INTEGER STATUS
2306  LOGICAL FOUND
2307 
2308  var => find_var(nc_start,'h',found)
2309  IF(.not. found) CALL fatal_error("COULD NOT FIND VARIABLE 'h'&
2310  & IN THE HOTSTART FILE OBJECT")
2311  CALL nc_connect_avar(var, h_lcl)
2312  CALL nc_read_var(var)
2313  CALL nc_disconnect(var)
2314 
real(sp), dimension(:), allocatable, target h_lcl
Definition: mod_setup.f90:61
type(ncfile), pointer nc_start
Definition: mod_input.f90:51
Here is the caller graph for this function:

◆ load_restart_grid()

subroutine mod_input::load_restart_grid ( integer, dimension(:,:), intent(out), allocatable, target  NVG)

Definition at line 2052 of file mod_input.f90.

2052  USE control
2053  IMPLICIT NONE
2054  INTEGER, ALLOCATABLE, TARGET, INTENT(OUT) :: NVG(:,:)
2055 
2056  TYPE(NCVAR), POINTER :: VAR
2057  TYPE(NCDIM), POINTER :: DIM1
2058  TYPE(NCDIM), POINTER :: DIM2
2059  integer status,I,IERR
2060 
2061  LOGICAL FOUND
2062 
2063  !==============================================================================|
2064 
2065 
2066  ! FIND THE RESTART FILE OBJECT
2067 
2068 
2069  ! GET GLOBAL DIMENSION!
2070  dim1 => find_dim(nc_start,"node",found)
2071  IF(.not. found) CALL fatal_error("COULD NOT FIND DIMENSION NODE&
2072  & IN THE HOTSTART FILE OBJECT")
2073 
2074  mgl = dim1%DIM
2075 
2076  dim1 => find_dim(nc_start,"nele",found)
2077  IF(.not. found) CALL fatal_error("COULD NOT FIND DIMENSION NODE&
2078  & IN THE HOTSTART FILE OBJECT")
2079 
2080  ngl= dim1%DIM
2081 
2082  ! CHECK TO MAKE SURE DIMENSION THREE IS THERE
2083  dim1 => find_dim(nc_start,"three",found)
2084  IF(.not. found) CALL fatal_error("COULD NOT FIND DIMENSION NODE&
2085  & IN THE HOTSTART FILE OBJECT")
2086 
2087  dim1 => find_dim(nc_start,"siglev",found)
2088  IF(.not. found) CALL fatal_error("COULD NOT FIND DIMENSION SIGLEV&
2089  & IN THE HOTSTART FILE OBJECT")
2090 
2091  kb = dim1%DIM
2092 
2093  dim1 => find_dim(nc_start,"siglay",found)
2094  IF(.not. found) CALL fatal_error("COULD NOT FIND DIMENSION SIGLEV&
2095  & IN THE HOTSTART FILE OBJECT")
2096 
2097  kbm1 = dim1%DIM
2098 
2099  kbm2 = kb - 2
2100 
2101 
2102  ALLOCATE(nvg(0:ngl,4),stat=status)
2103  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE YG_GRD")
2104  nvg=0
2105 
2106  var => find_var(nc_start,'nv',found)
2107  IF(.not. found) CALL fatal_error("COULD NOT FIND VARIABLE 'nv'&
2108  & IN THE HOTSTART FILE OBJECT")
2109  ! THIS IS DANGEROUS BUT IT WORKS... IN GENERAL IT IS NOT A GOOD
2110  ! IDEA TO PASS AROUND NON-CONTIGUOUS MEMORY POINTERS!
2111  var%ARR_INT => nvg(1:ngl,1:3)
2112 
2113  CALL nc_read_var(var)
2114  CALL nc_disconnect(var)
2115 
2116  nvg(:,4)=nvg(:,1)
2117 
2118  if(dbg_set(dbg_log)) then
2119  WRITE(ipt,*)'! Finished Reading Grid from HOTSTART'
2120  WRITE(ipt,*)'! # OF NODES :',mgl
2121  WRITE(ipt,*)'! # OF CELLS :',ngl
2122  WRITE(ipt,*)'! # OF LEVELS :',kb
2123  WRITE(ipt,*)'!'
2124  end if
2125 
integer kb
Definition: mod_main.f90:64
integer kbm2
Definition: mod_main.f90:66
integer, dimension(:,:), allocatable nvg
Definition: mod_main.f90:969
integer mgl
Definition: mod_main.f90:50
integer ipt
Definition: mod_main.f90:922
integer kbm1
Definition: mod_main.f90:65
integer ngl
Definition: mod_main.f90:49
type(ncfile), pointer nc_start
Definition: mod_input.f90:51
Here is the caller graph for this function:

◆ load_restart_lsf_grid()

subroutine mod_input::load_restart_lsf_grid ( integer, intent(out)  N_GL,
integer, dimension(:), intent(out), allocatable, target  I_GL,
real(sp), dimension(:), intent(out), allocatable, target  GEO_GL,
real(sp), dimension(:), intent(out), allocatable, target  WDF_GL 
)

Definition at line 2183 of file mod_input.f90.

2183  USE control
2184  IMPLICIT NONE
2185  INTEGER, INTENT(OUT) :: N_GL
2186  INTEGER, INTENT(OUT), Allocatable, TARGET :: I_GL(:)
2187  REAL(SP), INTENT(OUT), Allocatable, TARGET :: GEO_GL(:),WDF_GL(:)
2188 
2189  TYPE(NCVAR), POINTER :: VAR
2190  TYPE(NCDIM), POINTER :: DIM
2191  LOGICAL :: FOUND
2192 
2193 
2194  IF(.NOT. obc_longshore_flow_on) THEN
2195  if(dbg_set(dbg_log)) then
2196  WRITE(ipt,*)'! OPEN BOUNDARY LONGSHORE FLOW IS OFF '
2197  WRITE(ipt,*)'!'
2198  end if
2199  RETURN
2200  END IF
2201 
2202  dim => find_dim(nc_start,"nlsf",found)
2203  IF(.not. found) CALL fatal_error("COULD NOT FIND DIMENSION 'nlsf'&
2204  & IN THE HOTSTART FILE OBJECT")
2205 
2206  n_gl=dim%DIM
2207 
2208  ALLOCATE(i_gl(n_gl))
2209  ALLOCATE(geo_gl(n_gl))
2210  ALLOCATE(wdf_gl(n_gl))
2211 
2212 
2213  var => find_var(nc_start,'lsf_nodes',found)
2214  IF(.not. found) CALL fatal_error("COULD NOT FIND VARIABLE 'lsf_nodes'&
2215  & IN THE HOTSTART FILE OBJECT")
2216  CALL nc_connect_avar(var, i_gl)
2217  CALL nc_read_var(var)
2218  CALL nc_disconnect(var)
2219 
2220  var => find_var(nc_start,'wdf',found)
2221  IF(.not. found) CALL fatal_error("COULD NOT FIND VARIABLE 'wdf'&
2222  & IN THE HOTSTART FILE OBJECT")
2223  CALL nc_connect_avar(var, wdf_gl)
2224  CALL nc_read_var(var)
2225  CALL nc_disconnect(var)
2226 
2227  var => find_var(nc_start,'geo',found)
2228  IF(.not. found) CALL fatal_error("COULD NOT FIND VARIABLE 'geo'&
2229  & IN THE HOTSTART FILE OBJECT")
2230  CALL nc_connect_avar(var, geo_gl)
2231  CALL nc_read_var(var)
2232  CALL nc_disconnect(var)
2233 
2234 
2235  if(dbg_set(dbg_log)) then
2236  WRITE(ipt,*)'! FINISHED READING LSF GRID FROM HOTSTART:'
2237  WRITE(ipt,*)'! LSF NODES = :',n_gl
2238  WRITE(ipt,*)'!'
2239  end if
2240 
2241 
logical obc_longshore_flow_on
Definition: mod_main.f90:598
integer ipt
Definition: mod_main.f90:922
type(ncfile), pointer nc_start
Definition: mod_input.f90:51
Here is the caller graph for this function:

◆ load_restart_obc_grid()

subroutine mod_input::load_restart_obc_grid ( integer, intent(out)  IOBCN_GL,
integer, dimension(:), intent(out), allocatable, target  I_OBC_GL,
integer, dimension(:), intent(out), allocatable, target  TYPE_OBC_GL 
)

Definition at line 2130 of file mod_input.f90.

2130  USE control
2131  IMPLICIT NONE
2132  INTEGER, INTENT(OUT) :: IOBCN_GL
2133  INTEGER, INTENT(OUT), Allocatable, TARGET :: I_OBC_GL(:), TYPE_OBC_GL(:)
2134  TYPE(NCVAR), POINTER :: VAR
2135  TYPE(NCDIM), POINTER :: DIM
2136  LOGICAL :: FOUND
2137 
2138 
2139  IF(.NOT. obc_on) THEN
2140  if(dbg_set(dbg_log)) then
2141  WRITE(ipt,*)'! OBC IS OFF '
2142  WRITE(ipt,*)'!'
2143  end if
2144  RETURN
2145  END IF
2146 
2147 
2148  dim => find_dim(nc_start,"nobc",found)
2149  IF(.not. found) CALL fatal_error("COULD NOT FIND DIMENSION 'nobc'&
2150  & IN THE HOTSTART FILE OBJECT")
2151 
2152  iobcn_gl=dim%DIM
2153 
2154  if(iobcn_gl==0) return
2155 
2156  ALLOCATE(i_obc_gl(iobcn_gl))
2157  ALLOCATE(type_obc_gl(iobcn_gl))
2158 
2159  var => find_var(nc_start,'obc_nodes',found)
2160  IF(.not. found) CALL fatal_error("COULD NOT FIND VARIABLE 'obc_nodes'&
2161  & IN THE HOTSTART FILE OBJECT")
2162  CALL nc_connect_avar(var, i_obc_gl)
2163  CALL nc_read_var(var)
2164  CALL nc_disconnect(var)
2165 
2166  var => find_var(nc_start,'obc_type',found)
2167  IF(.not. found) CALL fatal_error("COULD NOT FIND VARIABLE 'obc_type'&
2168  & IN THE HOTSTART FILE OBJECT")
2169  CALL nc_connect_avar(var, type_obc_gl)
2170  CALL nc_read_var(var)
2171  CALL nc_disconnect(var)
2172 
2173  if(dbg_set(dbg_log)) then
2174  WRITE(ipt,*)'! FINISHED READING OBC GRID FROM HOTSTART:'
2175  WRITE(ipt,*)'! OBC NODES = :',iobcn_gl
2176  WRITE(ipt,*)'!'
2177  end if
2178 
2179 
logical obc_on
Definition: mod_main.f90:585
integer, dimension(:), allocatable i_obc_gl
Definition: mod_main.f90:1773
integer, dimension(:), allocatable type_obc_gl
Definition: mod_main.f90:1782
integer iobcn_gl
Definition: mod_main.f90:1775
integer ipt
Definition: mod_main.f90:922
type(ncfile), pointer nc_start
Definition: mod_input.f90:51
Here is the caller graph for this function:

◆ load_restart_sigma()

subroutine mod_input::load_restart_sigma ( real(sp), dimension(:,:), allocatable, target  Z,
real(sp), dimension(:,:), allocatable, target  Z1 
)

Definition at line 2351 of file mod_input.f90.

2351  USE all_vars, ONLY : n2e3d
2352  IMPLICIT NONE
2353  REAL(SP), ALLOCATABLE, TARGET:: Z(:,:),Z1(:,:)
2354  TYPE(NCVAR), POINTER :: VAR
2355  INTEGER STATUS
2356  LOGICAL FOUND
2357 
2358 
2359  var => find_var(nc_start,'siglev',found)
2360  IF(.not. found) CALL fatal_error("COULD NOT FIND VARIABLE 'siglev'&
2361  & IN THE HOTSTART FILE OBJECT")
2362  CALL nc_connect_avar(var, z)
2363  CALL nc_read_var(var)
2364  CALL nc_disconnect(var)
2365 
2366  CALL n2e3d(z,z1)
2367 
subroutine n2e3d(NVAR, EVAR)
Definition: mod_main.f90:1370
type(ncfile), pointer nc_start
Definition: mod_input.f90:51
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_restart_sponge()

subroutine mod_input::load_restart_sponge ( real(sp), dimension(:), allocatable, target  SPG)

Definition at line 2334 of file mod_input.f90.

2334  IMPLICIT NONE
2335  REAL(SP), ALLOCATABLE, TARGET:: SPG(:)
2336  TYPE(NCVAR), POINTER :: VAR
2337  INTEGER STATUS
2338  LOGICAL FOUND
2339 
2340 
2341  var => find_var(nc_start,'cc_sponge',found)
2342  IF(.not. found) CALL fatal_error("COULD NOT FIND VARIABLE 'cc_sponge'&
2343  & IN THE HOTSTART FILE OBJECT")
2344  CALL nc_connect_avar(var, spg)
2345  CALL nc_read_var(var)
2346  CALL nc_disconnect(var)
2347 
type(ncfile), pointer nc_start
Definition: mod_input.f90:51
Here is the caller graph for this function:

◆ name_list_initialize()

subroutine mod_input::name_list_initialize ( )

Definition at line 216 of file mod_input.f90.

216  USE control
217 
218  IMPLICIT NONE
219 
220  !--Parameters in NameList NML_CASE
221  case_title = "'AN FVCOM CASE DESCRIPTION' - note string must be in 'quotes'"
222  timezone = "Select Time Zone or for idealized case select 'none' (start time=0.0)"
223  use_real_world_time=.false.
224  date_format="A three letter string specify date format: 'YMD' or 'DMY'"
225  date_reference= "Date (specified as a string -- example '2007-11-05 00:00:00') or 'default'"
226  start_date= "Date and Time are specified as a string (example '2007-11-05 00:00:00')"
227  END_DATE= "For an idealized case specify 'seconds=(flt)','days=(flt)', or 'cycles=(int)'"
228 
229 
230  startup_type = "'hotstart', 'coldstart', 'forecast' or 'crashrestart'"
231  startup_file= trim(casename)//"_restart.nc"
232  startup_uv_type = "'default' or 'set values'"
233  startup_turb_type = "'default' or 'set values'"
234  startup_ts_type = "'constant' 'linear' 'observed' or 'set values'"
235  startup_t_vals = -99.0_sp
236  startup_s_vals = -99.0_sp
237  startup_u_vals = -99.0_sp
238  startup_v_vals = -99.0_sp
239  startup_dmax = -99.0_sp
240 
241  !--Parameters in NameList NML_IO
242  input_dir = "/Your/relative/path/to/input/files"
243  output_dir = "/Your/relative/path/to/output/files :Must already exist!"
244  ireport = 0
245  visit_all_vars = .false.
246  wait_for_visit = .false.
247  use_mpi_io_mode = .false.
248 
249 
250  !--Parameters in NameList NML_INTEGRATION
251  extstep_seconds = 0.0
252  isplit = 0
253  iramp = 0
254  static_ssh_adj = 0.0
255  min_depth = 0.0
256 
257  !--Parameters in NameList NML_RESTART
258  rst_on = .false.
259  rst_first_out = 'Date to start RESTART OUTPUT: Format the same as START_DATE'
260  rst_out_interval = "A length of time: 'seconds= ','days= ', or 'cycles= '"
261  rst_output_stack = 0
262 
263  !--Parameters in NameList NML_NETCDF
264  nc_on = .false.
265  nc_first_out = 'Date to start NETCDF OUTPUT: Format the same as START_DATE'
266  nc_out_interval = "A length of time: 'seconds= ','days= ', or 'cycles= '"
267  nc_output_stack = 0
268  nc_subdomain_files= "FVCOM"
269  nc_grid_metrics = .false.
270  nc_file_date = .false.
271  nc_velocity = .false.
272  nc_salt_temp = .false.
273  nc_turbulence = .false.
274  nc_average_vel = .false.
275  nc_vertical_vel = .false.
276  nc_nh_qp = .false.
277  nc_nh_rhs = .false.
278  nc_wind_vel = .false.
279  nc_wind_stress = .false.
280  nc_wave_para = .false. !Jadon
281  nc_wave_stress = .false. !Jadon
282  nc_evap_precip = .false.
283  nc_surface_heat = .false.
284  nc_groundwater = .false.
285  nc_vorticity = .false.
286  nc_wqm = .false.
287  nc_bio = .false.
288 
289  ! OUTPUT VARIABLES DEFAULT TO OFF
290 
291  !--Parameters in NameList NML_NETCDF_AV
292  ncav_on = .false.
293  ncav_first_out = "Date to start NETCDF interval averaged output: Format the same as START_DATE"
294  ncav_out_interval = "A length of time: 'seconds= ','days= ', or 'cycles= '"
296  ncav_subdomain_files= "FVCOM"
297  ncav_grid_metrics = .false.
298  ncav_file_date = .false.
299  ncav_velocity = .false.
300  ncav_salt_temp = .false.
301  ncav_turbulence = .false.
302  ncav_average_vel = .false.
303  ncav_vertical_vel = .false.
304  ncav_nh_qp = .false.
305  ncav_nh_rhs = .false.
306  ncav_wind_vel = .false.
307  ncav_wind_stress = .false.
308  ncav_wave_para = .false. !Jadon
309  ncav_wave_stress = .false. !Jadon
310  ncav_evap_precip = .false.
311  ncav_surface_heat = .false.
312  ncav_groundwater = .false.
313  ncav_vorticity = .false.
314  ncav_wqm = .false.
315  ncav_bio = .false.
316 
317 
318  ! OUTPUT VARIABLES DEFAULT TO OFF
319 
320  !--Parameters in NameList NML_PHYSICS
321  horizontal_mixing_type = "'closure' or 'constant'"
322  horizontal_mixing_file = trim(casename)//"_hvc.nc"
323  horizontal_mixing_kind = "Options:"//trim(cnstnt)//","//trim(sttc)
325  horizontal_prandtl_number = -1.0_sp
326 
327  vertical_mixing_type = "'closure' or 'constant'"
329  vertical_prandtl_number = -1.0_sp
330 
331 
332  bottom_roughness_minimum = -1.0_sp
334  bottom_roughness_type = "'"//trim(br_orig)//"', or '"&
335  &//trim(br_gotm)//"'; Select your bottom roughness equation (brough.F)"
336  bottom_roughness_kind = "Options:"//trim(cnstnt)//","//trim(sttc)
337  bottom_roughness_file =trim(casename)//"_brf.nc"
338 
339  convective_overturning = .false.
340  scalar_positivity_control = .false.
341  barotropic = .false.
342 
343  baroclinic_pressure_gradient = "'sigma levels' or 'z coordinates'; select method of calculation"
344 
345  sea_water_density_function = "'"//trim(sw_dens1)//"', '"&
346  &//trim(sw_dens2)//"', or '"//trim(sw_dens3)//"; Select your equation of state (eqs_of_state.F)"
347 
348  recalculate_rho_mean = .false.
349  interval_rho_mean = "A length of time or number of cycles in standard format"
350 
351  temperature_active = .false.
352  salinity_active = .false.
353  surface_wave_mixing = .false.
354  wetting_drying_on = .false.
355 !J. Ge
356  ! for tracer advection
357  backward_advection = .false.
358  backward_step = -1
359 !J. Ge
360 
361  adcor_on = .true.
362  equator_beta_plane = .false.
363  noflux_bot_condition = .true.
364 
365  !--Parameters in NameList NML_SURFACE_FORCING
366  wind_on = .false.
367  wind_type = "Options::"//trim(speed)//","//trim(stress)
368  wind_file = trim(casename)//"_wnd.nc"
369  wind_kind = "Options:"//trim(cnstnt)//","//trim(sttc)//","//trim(tmdpndnt)//","//trim(prdc)//","//trim(vrbl)
370  wind_x = 0.0_sp
371  wind_y = 0.0_sp
372  heating_on = .false.
373  heating_type = "'body' or 'flux'"
374  heating_file = trim(casename)//"_hfx.nc"
375  heating_kind = "Options:"//trim(cnstnt)//","//trim(sttc)//","//trim(tmdpndnt)//","//trim(prdc)//","//trim(vrbl)
376  heating_radiation = 0.0_sp
377  heating_netflux = 0.0_sp
378  heating_longwave_perctage = 0.78_sp
381  precipitation_on = .false.
382  precipitation_file = trim(casename)//"_emp.nc"
383  precipitation_kind = "Options:"//trim(cnstnt)//","//trim(sttc)//","//trim(tmdpndnt)//","//trim(prdc)//","//trim(vrbl)
384  precipitation_prc = 0.0_sp
385  precipitation_evp = 0.0_sp
386  airpressure_on = .false.
387  airpressure_kind = "Options:"//trim(cnstnt)//","//trim(sttc)//","//trim(tmdpndnt)//","//trim(prdc)//","//trim(vrbl)
388  airpressure_file = trim(casename)//"_aip.nc"
389  airpressure_value = 0.0_sp
390 ! Jadon
391  wave_on = .false.
392  wave_file = trim(casename)//"_wav.nc"
393  wave_kind = "Options:"//trim(cnstnt)//","//trim(sttc)//","//trim(tmdpndnt)//","//trim(prdc)//","//trim(vrbl)
394  wave_height = 0.0_sp
395  wave_length = 0.0_sp
396  wave_direction = 0.0_sp
397  wave_period = 0.0_sp
398  wave_per_bot = 0.0_sp
399  wave_ub_bot = 0.0_sp
400 
401  !--Parameters in NameList NML_RIVER_TYPE
402  river_number = -1
403  river_kind = "Options:"//trim(prdc)//" or "//trim(vrbl)
404  river_ts_setting = "'calculated' or 'specified'"
405  river_inflow_location = "'node' or 'edge'"
406  river_info_file = "'default' or 'filename'"
407 
408 
409  !--Parameters in NameList NML_RIVERS
410  river_name = "River Name in netcdf data file; use mulitple namelists for multiple rivers!"
411  river_file = trim(casename)//"_riv.nc"
414 
415  !--Parameters in NameList NML_OPEN_BOUNDARY
416  obc_on = .false.
417  obc_node_list_file = trim(casename)//"_obc.dat"
418  obc_elevation_forcing_on = .false.
419  obc_elevation_file = trim(casename)//"_obc.nc "
420  obc_ts_type = -1
421  obc_temp_nudging = .false.
422  obc_temp_file = trim(casename)//"_obc.nc "
424  obc_salt_nudging = .false.
425  obc_salt_file = trim(casename)//"_obc.nc "
427  obc_meanflow = .false.
428  obc_meanflow_file = trim(casename)//"_obc.nc"
429  obc_longshore_flow_on = .false.
430  obc_longshore_flow_file = trim(casename)//"_lsf.dat"
431  obc_tideout_initial = 0 !TIME STEPS
432  obc_tideout_interval = 0 !TIME STEPS
433  obc_depth_control_on = .true.
434 
435  !--Parameters in NameList GRID_COORDINATES
436  grid_file = trim(casename)//"_grd.dat"
437  grid_file_units = "Can be 'degrees' or 'meters'; certain make options required"
438  projection_reference = "none: A recognized reference coordinate for proj&
439  &tion for PROJ4"
440  sigma_levels_file = trim(casename)//"_sigma.dat"
441  coriolis_file = trim(casename)//"_cor.dat"
442  depth_file = trim(casename)//"_dep.dat"
443  sponge_file = trim(casename)//"_spg.dat"
444 
445 
446  !--Parameters in NameList NML_GROUNDWATER
447  groundwater_on = .false.
448  groundwater_salt_on = .false.
449  groundwater_temp_on = .false.
450  groundwater_kind ="Options:"//trim(cnstnt)//","//trim(sttc)&
451  &//","//trim(tmdpndnt)//","//trim(prdc)//","//trim(vrbl)
452  groundwater_file = trim(casename)//"_grndwtr.nc"
453  groundwater_flow = 0.0
454  groundwater_temp = 0.0
455  groundwater_salt = 0.0
456 
457  !--Parameters in NameList NML_LAG_PART
458  lag_particles_on = .false.
459  lag_start_file = "init_lag.nc"
460  lag_out_file = "lag_out.nc"
461  lag_first_out = "A Date or time"
462  lag_restart_file = "lag_restart.nc"
463  lag_out_interval = "A length of time: 'seconds= ','days= ', or 'cycles= '"
464  lag_scal_choice = "none"
465 
466 
467  !--Parameters in NameList NML_ADDITIONAL_MODELS
468 ! WATER_QUALITY_MODEL = .FALSE.
469 ! WATER_QUALITY_MODEL_FILE = "DO NOT ADD UNTILL FVCOM IS RUNNING BY ITS SELF FIRST"
470  data_assimilation = .false.
471  data_assimilation_file = "./"//trim(casename)//"_run.nml"
472  biological_model= .false.
473 !--------- J. Ge for biology --------------
474  biological_model_file = "DO NOT ADD UNTILL FVCOM IS RUNNING BY ITS SELF FIRST"
475 !------------------------------------------
476  startup_bio_type = "'observed' use this option only now" ! constant, linear, observed, set values
477  sediment_model= .false.
478  sediment_model_file = "DO NOT ADD UNTILL FVCOM IS RUNNING BY ITS SELF FIRST"
479  sediment_parameter_type = "DO NOT ADD UNTILL FVCOM IS RUNNING BY ITS SELF FIRST"
480  sediment_parameter_file = "DO NOT ADD UNTILL FVCOM IS RUNNING BY ITS SELF FIRST"
481  bedflag_type = "DO NOT ADD UNTIL FVCOM IS RUNNING BY ITS SELF FIRST"
482  bedflag_file = "DO NOT ADD UNTILL FVCOM IS RUNNING BY ITS SELF FIRST"
483  ice_model= .false.
484  ice_forcing_file = "DO NOT ADD UNTILL FVCOM IS RUNNING BY ITS SELF FIRST"
485  ice_forcing_kind ="Options:"//trim(cnstnt)//","//trim(sttc)&
486  &//","//trim(tmdpndnt)//","//trim(prdc)//","//trim(vrbl)
488  ice_air_temp = 0.0
489  ice_spec_humidity = 0.0
490  ice_cloud_cover = 0.0
491  ice_shortwave = 0.0
492  ice_longwave_type = "'PW' or 'RM'" !PW -- longwave as in Parkinson and Washington (1979)
493  !RM -- longwave, Rosati and Miyakoda, JPO 18, p. 1607 (1988)
494 
495  icing_model= .false.
496  icing_forcing_file = "DO NOT ADD UNTILL FVCOM IS RUNNING BY ITS SELF FIRST"
497  icing_forcing_kind ="Options:"//trim(cnstnt)//","//trim(sttc)&
498  &//","//trim(tmdpndnt)//","//trim(prdc)//","//trim(vrbl)
499  icing_air_temp = 0.0
500  icing_wspd = 0.0
501 
502  probes_on = .false.
503  probes_number =0
504  probes_file = "Probe namelist file name"
505 
506  high_latitude_wave = .false.
507 
logical nc_nh_rhs
Definition: mod_main.f90:254
logical equator_beta_plane
Definition: mod_main.f90:404
real(sp) precipitation_evp
Definition: mod_main.f90:469
character(len=80) wave_kind
Definition: mod_main.f90:479
logical ncav_evap_precip
Definition: mod_main.f90:318
logical scalar_positivity_control
Definition: mod_main.f90:380
logical nc_wind_stress
Definition: mod_main.f90:259
character(len=80) casename
Definition: mod_main.f90:116
real(dp) extstep_seconds
Definition: mod_main.f90:201
character(len=80) airpressure_kind
Definition: mod_main.f90:474
character(len=80) icing_forcing_file
Definition: mod_main.f90:720
logical obc_temp_nudging
Definition: mod_main.f90:590
character(len=80), parameter sttc
Definition: mod_main.f90:489
logical wait_for_visit
Definition: mod_main.f90:187
character(len=80) coriolis_file
Definition: mod_main.f90:630
character(len=80) obc_longshore_flow_file
Definition: mod_main.f90:599
integer nc_output_stack
Definition: mod_main.f90:241
logical wetting_drying_on
Definition: mod_main.f90:394
logical nc_velocity
Definition: mod_main.f90:247
logical surface_wave_mixing
Definition: mod_main.f90:391
logical ncav_grid_metrics
Definition: mod_main.f90:300
character(len=80) date_format
Definition: mod_main.f90:125
real(sp) wave_ub_bot
Definition: mod_main.f90:485
real(sp) vertical_mixing_coefficient
Definition: mod_main.f90:362
character(len=80), parameter sw_dens3
Definition: mod_main.f90:401
character(len=80) wind_type
Definition: mod_main.f90:444
real(sp) ice_spec_humidity
Definition: mod_main.f90:730
character(len=80) lag_start_file
Definition: mod_main.f90:672
logical ncav_wave_stress
Definition: mod_main.f90:317
character(len=80) startup_ts_type
Definition: mod_main.f90:143
integer iramp
Definition: mod_main.f90:208
real(sp) ice_shortwave
Definition: mod_main.f90:732
logical obc_salt_nudging
Definition: mod_main.f90:593
logical nc_evap_precip
Definition: mod_main.f90:262
logical ncav_average_vel
Definition: mod_main.f90:307
logical barotropic
Definition: mod_main.f90:381
character(len=80) river_info_file
Definition: mod_main.f90:542
character(len=80) precipitation_kind
Definition: mod_main.f90:468
logical nc_average_vel
Definition: mod_main.f90:251
character(len=80) data_assimilation_file
Definition: mod_main.f90:705
real(sp) wind_y
Definition: mod_main.f90:448
character(len=80) heating_file
Definition: mod_main.f90:452
real(sp) startup_v_vals
Definition: mod_main.f90:149
character(len=80) depth_file
Definition: mod_main.f90:629
integer obc_ts_type
Definition: mod_main.f90:589
real(sp) airpressure_value
Definition: mod_main.f90:475
character(len=80) startup_type
Definition: mod_main.f90:141
character(len=80) startup_uv_type
Definition: mod_main.f90:144
character(len=80) sediment_parameter_file
Definition: mod_main.f90:715
real(sp) ice_air_temp
Definition: mod_main.f90:729
real(sp) wave_period
Definition: mod_main.f90:483
character(len=80) river_name
Definition: mod_main.f90:559
character(len=80), parameter sw_dens1
Definition: mod_main.f90:399
character(len=80) startup_bio_type
Definition: mod_main.f90:711
logical obc_on
Definition: mod_main.f90:585
logical use_mpi_io_mode
Definition: mod_main.f90:188
real(sp) horizontal_prandtl_number
Definition: mod_main.f90:355
character(len=80) ice_longwave_type
Definition: mod_main.f90:733
real(sp) heating_longwave_lengthscale
Definition: mod_main.f90:455
character(len=120) ncav_subdomain_files
Definition: mod_main.f90:298
character(len=80) obc_temp_file
Definition: mod_main.f90:591
character(len=80) wave_file
Definition: mod_main.f90:478
logical ncav_velocity
Definition: mod_main.f90:303
real(sp), dimension(max_layers) river_vertical_distribution
Definition: mod_main.f90:564
logical temperature_active
Definition: mod_main.f90:384
logical high_latitude_wave
Definition: mod_main.f90:735
character(len=80) sediment_parameter_type
Definition: mod_main.f90:714
character(len=80) rst_out_interval
Definition: mod_main.f90:224
character(len=80) lag_first_out
Definition: mod_main.f90:674
character(len=80) output_dir
Definition: mod_main.f90:184
real(sp) bottom_roughness_minimum
Definition: mod_main.f90:371
logical nc_nh_qp
Definition: mod_main.f90:253
character(len=80) startup_turb_type
Definition: mod_main.f90:145
character(len=80) ncav_out_interval
Definition: mod_main.f90:296
logical nc_turbulence
Definition: mod_main.f90:249
real(sp) heating_radiation
Definition: mod_main.f90:457
character(len=80) precipitation_file
Definition: mod_main.f90:467
logical obc_meanflow
Definition: mod_main.f90:596
logical ncav_turbulence
Definition: mod_main.f90:305
real(sp) heating_shortwave_lengthscale
Definition: mod_main.f90:456
logical nc_salt_temp
Definition: mod_main.f90:248
character(len=80) grid_file_units
Definition: mod_main.f90:626
character(len=80) bedflag_file
Definition: mod_main.f90:717
character(len=80) interval_rho_mean
Definition: mod_main.f90:397
character(len=80) lag_out_file
Definition: mod_main.f90:673
logical backward_advection
Definition: mod_main.f90:388
logical ncav_vertical_vel
Definition: mod_main.f90:306
logical ncav_salt_temp
Definition: mod_main.f90:304
character(len=200) projection_reference
Definition: mod_main.f90:627
logical ncav_wind_stress
Definition: mod_main.f90:315
logical nc_vertical_vel
Definition: mod_main.f90:250
logical ncav_bio
Definition: mod_main.f90:321
real(sp) groundwater_salt
Definition: mod_main.f90:655
real(sp) ice_cloud_cover
Definition: mod_main.f90:731
integer probes_number
Definition: mod_main.f90:795
real(sp) obc_temp_nudging_timescale
Definition: mod_main.f90:592
real(sp) heating_netflux
Definition: mod_main.f90:458
character(len=80) date_reference
Definition: mod_main.f90:129
character(len=80) horizontal_mixing_kind
Definition: mod_main.f90:353
logical obc_elevation_forcing_on
Definition: mod_main.f90:587
character(len=80) river_kind
Definition: mod_main.f90:541
real(sp) vertical_prandtl_number
Definition: mod_main.f90:363
logical nc_groundwater
Definition: mod_main.f90:264
logical visit_all_vars
Definition: mod_main.f90:186
real(sp) ice_sea_level_pressure
Definition: mod_main.f90:728
logical convective_overturning
Definition: mod_main.f90:379
character(len=80) icing_forcing_kind
Definition: mod_main.f90:721
character(len=80) sponge_file
Definition: mod_main.f90:631
character(len=80), parameter br_gotm
Definition: mod_main.f90:377
character(len=80), parameter speed
Definition: mod_main.f90:494
real(sp), dimension(2) startup_s_vals
Definition: mod_main.f90:147
character(len=80) startup_file
Definition: mod_main.f90:142
character(len=80) river_file
Definition: mod_main.f90:560
logical groundwater_salt_on
Definition: mod_main.f90:656
character(len=80) heating_type
Definition: mod_main.f90:451
logical ncav_surface_heat
Definition: mod_main.f90:319
logical nc_on
Definition: mod_main.f90:238
character(len=80) rst_first_out
Definition: mod_main.f90:223
real(sp) wave_direction
Definition: mod_main.f90:482
character(len=80) ice_forcing_kind
Definition: mod_main.f90:727
integer river_number
Definition: mod_main.f90:544
character(len=80) obc_node_list_file
Definition: mod_main.f90:586
logical sediment_model
Definition: mod_main.f90:712
character(len=80) baroclinic_pressure_gradient
Definition: mod_main.f90:383
character(len=80) lag_out_interval
Definition: mod_main.f90:676
character(len=80) case_title
Definition: mod_main.f90:124
logical obc_longshore_flow_on
Definition: mod_main.f90:598
logical ncav_wind_vel
Definition: mod_main.f90:314
character(len=80) timezone
Definition: mod_main.f90:126
character(len=80) groundwater_file
Definition: mod_main.f90:651
real(sp) obc_salt_nudging_timescale
Definition: mod_main.f90:595
real(sp) startup_u_vals
Definition: mod_main.f90:148
integer ireport
Definition: mod_main.f90:185
integer river_grid_location
Definition: mod_main.f90:561
character(len=80) biological_model_file
Definition: mod_main.f90:708
logical obc_depth_control_on
Definition: mod_main.f90:601
character(len=80) grid_file
Definition: mod_main.f90:625
logical precipitation_on
Definition: mod_main.f90:466
logical wave_on
Definition: mod_main.f90:477
character(len=80) sediment_model_file
Definition: mod_main.f90:713
character(len=80), parameter sw_dens2
Definition: mod_main.f90:400
logical ice_model
Definition: mod_main.f90:725
logical nc_surface_heat
Definition: mod_main.f90:263
logical noflux_bot_condition
Definition: mod_main.f90:405
character(len=80), parameter br_orig
Definition: mod_main.f90:376
character(len=80) lag_restart_file
Definition: mod_main.f90:675
logical salinity_active
Definition: mod_main.f90:385
character(len=80) nc_first_out
Definition: mod_main.f90:239
real(sp), dimension(2) startup_t_vals
Definition: mod_main.f90:146
character(len=80) heating_kind
Definition: mod_main.f90:453
real(sp) groundwater_flow
Definition: mod_main.f90:652
logical ncav_groundwater
Definition: mod_main.f90:320
logical lag_particles_on
Definition: mod_main.f90:671
logical nc_grid_metrics
Definition: mod_main.f90:244
logical nc_file_date
Definition: mod_main.f90:245
character(len=80) ice_forcing_file
Definition: mod_main.f90:726
character(len=80) obc_meanflow_file
Definition: mod_main.f90:597
character(len=80) groundwater_kind
Definition: mod_main.f90:650
logical ncav_vorticity
Definition: mod_main.f90:308
real(sp) groundwater_temp
Definition: mod_main.f90:653
character(len=80), parameter stress
Definition: mod_main.f90:495
character(len=80) wind_kind
Definition: mod_main.f90:446
logical nc_vorticity
Definition: mod_main.f90:252
logical use_real_world_time
Definition: mod_main.f90:131
logical groundwater_on
Definition: mod_main.f90:649
logical ncav_on
Definition: mod_main.f90:294
logical airpressure_on
Definition: mod_main.f90:472
integer obc_tideout_interval
Definition: mod_main.f90:600
logical nc_wave_stress
Definition: mod_main.f90:261
logical recalculate_rho_mean
Definition: mod_main.f90:396
logical icing_model
Definition: mod_main.f90:719
integer obc_tideout_initial
Definition: mod_main.f90:600
real(sp) static_ssh_adj
Definition: mod_main.f90:209
real(sp) wave_height
Definition: mod_main.f90:480
character(len=80), parameter cnstnt
Definition: mod_main.f90:488
character(len=80), parameter vrbl
Definition: mod_main.f90:492
integer rst_output_stack
Definition: mod_main.f90:225
real(sp) icing_air_temp
Definition: mod_main.f90:722
real(sp) horizontal_mixing_coefficient
Definition: mod_main.f90:354
character(len=80) bottom_roughness_type
Definition: mod_main.f90:369
character(len=80) sea_water_density_function
Definition: mod_main.f90:382
real(sp) precipitation_prc
Definition: mod_main.f90:470
logical adcor_on
Definition: mod_main.f90:403
character(len=80) bedflag_type
Definition: mod_main.f90:716
logical wind_on
Definition: mod_main.f90:443
integer backward_step
Definition: mod_main.f90:389
real(sp) wave_length
Definition: mod_main.f90:481
logical nc_wind_vel
Definition: mod_main.f90:258
real(sp) startup_dmax
Definition: mod_main.f90:150
character(len=80) horizontal_mixing_type
Definition: mod_main.f90:351
logical data_assimilation
Definition: mod_main.f90:704
character(len=80), parameter tmdpndnt
Definition: mod_main.f90:490
character(len=80) input_dir
Definition: mod_main.f90:183
logical ncav_wave_para
Definition: mod_main.f90:316
character(len=80) horizontal_mixing_file
Definition: mod_main.f90:352
character(len=80) probes_file
Definition: mod_main.f90:796
real(sp) heating_longwave_perctage
Definition: mod_main.f90:454
logical heating_on
Definition: mod_main.f90:450
logical rst_on
Definition: mod_main.f90:222
character(len=80) airpressure_file
Definition: mod_main.f90:473
character(len=80) ncav_first_out
Definition: mod_main.f90:295
character(len=80) sigma_levels_file
Definition: mod_main.f90:628
integer ncav_output_stack
Definition: mod_main.f90:297
character(len=80) river_ts_setting
Definition: mod_main.f90:538
real(sp) wave_per_bot
Definition: mod_main.f90:484
character(len=80) bottom_roughness_file
Definition: mod_main.f90:370
logical probes_on
Definition: mod_main.f90:794
character(len=80) obc_elevation_file
Definition: mod_main.f90:588
character(len=80) river_inflow_location
Definition: mod_main.f90:540
logical ncav_nh_qp
Definition: mod_main.f90:309
logical nc_bio
Definition: mod_main.f90:265
logical nc_wqm
Definition: mod_main.f90:266
character(len=80) obc_salt_file
Definition: mod_main.f90:594
logical ncav_nh_rhs
Definition: mod_main.f90:310
character(len=80) lag_scal_choice
Definition: mod_main.f90:677
real(sp) bottom_roughness_lengthscale
Definition: mod_main.f90:372
character(len=120) nc_subdomain_files
Definition: mod_main.f90:242
character(len=80), parameter prdc
Definition: mod_main.f90:491
character(len=80) start_date
Definition: mod_main.f90:127
character(len=80) wind_file
Definition: mod_main.f90:445
character(len=80) vertical_mixing_type
Definition: mod_main.f90:361
real(sp) wind_x
Definition: mod_main.f90:447
real(sp) icing_wspd
Definition: mod_main.f90:723
character(len=80) bottom_roughness_kind
Definition: mod_main.f90:368
integer isplit
Definition: mod_main.f90:203
logical ncav_file_date
Definition: mod_main.f90:301
real(sp) min_depth
Definition: mod_main.f90:210
character(len=80) nc_out_interval
Definition: mod_main.f90:240
logical ncav_wqm
Definition: mod_main.f90:322
logical nc_wave_para
Definition: mod_main.f90:260
logical biological_model
Definition: mod_main.f90:706
logical groundwater_temp_on
Definition: mod_main.f90:654
Here is the caller graph for this function:

◆ name_list_print()

subroutine mod_input::name_list_print ( )

Definition at line 512 of file mod_input.f90.

512  USE control
513 
514  IMPLICIT NONE
515 
516 
517  ! MODIFY THIS ROUTINE TO PRINT EACH NAME LIST TO A CHARCTER STRING:
518  ! PARSE AND FORMAT THE STRING TO MAKE IT LOOK 'PRETTY'!
519 
520  write(unit=ipt,nml=nml_case)
521  write(unit=ipt,nml=nml_startup)
522  write(unit=ipt,nml=nml_io)
523  write(unit=ipt,nml=nml_integration)
524  write(unit=ipt,nml=nml_restart)
525  write(unit=ipt,nml=nml_netcdf)
526  write(unit=ipt,nml=nml_netcdf_av)
527  write(unit=ipt,nml=nml_surface_forcing)
528  write(unit=ipt,nml=nml_physics)
529  write(unit=ipt,nml=nml_river_type)
530  write(unit=ipt,nml=nml_river)
531  write(unit=ipt,nml=nml_open_boundary_control)
532  write(unit=ipt,nml=nml_grid_coordinates)
533  write(unit=ipt,nml=nml_groundwater)
534  write(unit=ipt,nml=nml_lag)
535  write(unit=ipt,nml=nml_additional_models)
536  write(unit=ipt,nml=nml_probes)
537  write(unit=ipt,nml=nml_boundschk) !bounds checking
538 
539  RETURN
integer ipt
Definition: mod_main.f90:922
Here is the caller graph for this function:

◆ name_list_read()

subroutine mod_input::name_list_read ( )

Definition at line 544 of file mod_input.f90.

544  USE control
545  IMPLICIT NONE
546  integer :: ios, i
547  Character(Len=120):: FNAME
548  character(len=160) :: pathnfile
549  if(dbg_set(dbg_sbr)) &
550  & write(ipt,*) "Subroutine Begins: Read_Name_List;"
551 
552  ios = 0
553 
554  fname = "./"//trim(casename)//"_run.nml"
555 
556  if(dbg_set(dbg_io)) &
557  & write(ipt,*) "Read_Name_List: File: ",trim(fname)
558 
559  CALL fopen(nmlunit,trim(fname),'cfr')
560 
561  !READ NAME LIST FILE
562 
563  ! Read IO Information
564  READ(unit=nmlunit, nml=nml_io,iostat=ios)
565  if(ios .NE. 0 ) Then
566  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_io)
567  Call fatal_error("Can Not Read NameList NML_IO from file: "//trim(fname))
568  end if
569  CALL check_io_dirs
570 
571  rewind(nmlunit)
572 
573  if(dbg_set(dbg_scl)) &
574  & write(ipt,*) "Read_Name_List:"
575 
576  if(dbg_set(dbg_scl)) &
577  & write(unit=ipt,nml=nml_io)
578 
579  ! Read Case Information
580  READ(unit=nmlunit, nml=nml_case,iostat=ios)
581  if(ios .NE. 0 ) THEN
582  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_case)
583  CALL fatal_error("Can Not Read NameList NML_CASE from file: "//trim(fname))
584  end if
585 
586  rewind(nmlunit)
587 
588  if(dbg_set(dbg_scl)) &
589  & write(ipt,*) "Read_Name_List:"
590 
591  if(dbg_set(dbg_scl)) &
592  & write(unit=ipt,nml=nml_case)
593 
594  ! Read STARTUP TYPE INFORMATION
595  READ(unit=nmlunit, nml=nml_startup,iostat=ios)
596  if(ios .NE. 0 ) Then
597  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_startup)
598  Call fatal_error("Can Not Read NameList NML_STARTUP from file: "//trim(fname))
599  end if
600 
601  rewind(nmlunit)
602 
603  if(dbg_set(dbg_scl)) &
604  & write(ipt,*) "Read_Name_List:"
605 
606  if(dbg_set(dbg_scl)) &
607  & write(unit=ipt,nml=nml_startup)
608 
609  ! Read Integration Settings
610  READ(unit=nmlunit, nml=nml_integration,iostat=ios)
611  if(ios .NE. 0 ) Then
612  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_integration)
613  Call fatal_error("Can Not Read NameList NML_INTEGRATION from file: "//trim(fname))
614  end if
615 
616  rewind(nmlunit)
617 
618  if(dbg_set(dbg_scl)) &
619  & write(ipt,*) "Read_Name_List:"
620 
621  if(dbg_set(dbg_scl)) &
622  & write(unit=ipt,nml=nml_integration)
623 
624  ! Read Netcdf Output Settings
625  READ(unit=nmlunit, nml=nml_restart,iostat=ios)
626  if(ios .NE. 0 ) then
627  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_restart)
628  Call fatal_error("Can Not Read NameList NML_RESTART from file: "//trim(fname))
629  end if
630 
631  rewind(nmlunit)
632 
633  if(dbg_set(dbg_scl)) &
634  & write(ipt,*) "Read_Name_List:"
635 
636  if(dbg_set(dbg_scl)) &
637  & write(unit=ipt,nml=nml_restart)
638 
639  ! Read Netcdf Output Settings
640  READ(unit=nmlunit, nml=nml_netcdf,iostat=ios)
641  if(ios .NE. 0 ) then
642  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_netcdf)
643  Call fatal_error("Can Not Read NameList NML_NETCDF from file: "//trim(fname))
644  end if
645 
646  rewind(nmlunit)
647 
648  if(dbg_set(dbg_scl)) &
649  & write(ipt,*) "Read_Name_List:"
650 
651  if(dbg_set(dbg_scl)) &
652  & write(unit=ipt,nml=nml_netcdf)
653 
654  ! Read Netcdf Average Output Settings
655  READ(unit=nmlunit, nml=nml_netcdf_av,iostat=ios)
656  if(ios .NE. 0 ) then
657  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_netcdf_av)
658  Call fatal_error("Can Not Read NameList NML_NETCDF_AV from file: "//trim(fname))
659  end if
660 
661  rewind(nmlunit)
662 
663  if(dbg_set(dbg_scl)) &
664  & write(ipt,*) "Read_Name_List:"
665 
666  if(dbg_set(dbg_scl)) &
667  & write(unit=ipt,nml=nml_netcdf_av)
668 
669  ! Read Model Physics Settings
670  READ(unit=nmlunit, nml=nml_physics,iostat=ios)
671  if(ios .NE. 0 ) then
672  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_physics)
673  Call fatal_error("Can Not Read NameList NML_PHYSICS from file: "//trim(fname))
674  end if
675 
676  rewind(nmlunit)
677 
678  if(dbg_set(dbg_scl)) &
679  & write(ipt,*) "Read_Name_List:"
680 
681  if(dbg_set(dbg_scl)) &
682  & write(unit=ipt,nml=nml_physics)
683 
684 
685  ! Read Surface Forcing Settings
686  READ(unit=nmlunit, nml=nml_surface_forcing,iostat=ios)
687  if(ios .NE. 0 ) then
688  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_surface_forcing)
689  Call fatal_error("Can Not Read NameList NML_SURFACE_FORCING from file: "//trim(fname))
690  end if
691 
692  rewind(nmlunit)
693 
694  if(dbg_set(dbg_scl)) &
695  & write(ipt,*) "Read_Name_List:"
696 
697  if(dbg_set(dbg_scl)) &
698  & write(unit=ipt,nml=nml_surface_forcing)
699 
700 
701  ! Read River settings
702  READ(unit=nmlunit, nml=nml_river_type,iostat=ios)
703  if(ios .NE. 0 ) then
704  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_river_type)
705  Call fatal_error("Can Not Read NameList NML_RIVER_TYPE from file: "//trim(fname))
706  end if
707 
708  if(dbg_set(dbg_scl)) &
709  & write(ipt,*) "Read_Name_List:"
710 
711  if(dbg_set(dbg_scl)) &
712  & write(unit=ipt,nml=nml_river_type)
713 
714  IF(river_number > 0) THEN
715  SELECT CASE (river_info_file(2:8))
716  CASE('default')
717  rewind(nmlunit)
719  !! 'default' use present runfile namelist
720  CASE DEFAULT
721  !! use the specified river file information
722  rivernmlunit=800
723  pathnfile = trim(input_dir)//trim(river_info_file)
724  Call fopen(rivernmlunit,trim(pathnfile),'cfr')
725  END SELECT
726 
727  ALLOCATE(rivers(river_number))
728 
729  ! Read River Namelists...
730  ios = 0
731  i = 0
732  DO
733  READ(unit=rivernmlunit, nml=nml_river,iostat=ios)
734 
735  if (ios /= 0 ) exit
736  i = i +1
737  if (i > river_number) exit ! To prevent sigsev...
738 
739  rivers(i)%NAME=river_name
740  rivers(i)%FILE=river_file
741  rivers(i)%LOCATION=river_grid_location
742  rivers(i)%DISTRIBUTION=river_vertical_distribution
743  END DO
744 
745  IF(i .NE. river_number) THEN
746  if(dbg_set(dbg_log)) then
747  write(ipt,*)"Bad River data in the Name List!"
748  write(ipt,*)"Specified number of rivers:",river_number
749  write(ipt,*)"But Found",i, "; Valid river name list objects.(Printing Last)"
750  write(unit=ipt,nml=nml_river)
751  end if
752 
753  CALL fatal_error('PLEASE REPAIR THE NAME LIST SO IT IS CONSISTANT... see above')
754  END IF
755 
756  ELSE IF (river_number .eq. 0) THEN
757 
758  READ(unit=nmlunit, nml=nml_river,iostat=ios)
759  !THERE SHOULD BE NO RIVER NAME LISTS
760  if (ios == 0 ) CALL fatal_error &
761  & ('THERE ARE ONE OR MORE RIVER NAME LISTS, BUT RIVER TYPE SPECIFIED ZERO RIVERS?')
762 
763  ELSE
764  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_river_type)
765  CALL fatal_error("YOU CAN'T HAVE A NEGATIVE NUMBER OF RIVERS!")
766  END IF
767 
768 
769  rewind(nmlunit)
770 
771 
772  ! Read Open Boundary Control Settings
773  READ(unit=nmlunit, nml=nml_open_boundary_control,iostat=ios)
774  if(ios .NE. 0 ) then
775  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_open_boundary_control)
776  Call fatal_error("Can Not Read NameList NML_OPEN_BOUNDARY_CONTROL from file: "//trim(fname))
777  end if
778 
779  rewind(nmlunit)
780 
781  if(dbg_set(dbg_scl)) &
782  & write(ipt,*) "Read_Name_List:"
783 
784  if(dbg_set(dbg_scl)) &
785  & write(unit=ipt,nml=nml_open_boundary_control)
786 
787 
788  ! Read Grid Coordinates Settings
789  READ(unit=nmlunit, nml=nml_grid_coordinates,iostat=ios)
790  if(ios .NE. 0 ) then
791  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_grid_coordinates)
792  Call fatal_error("Can Not Read NameList NML_GRID_COORDINATES from file: "//trim(fname))
793  end if
794 
795  rewind(nmlunit)
796 
797  if(dbg_set(dbg_scl)) &
798  & write(ipt,*) "Read_Name_List:"
799 
800  if(dbg_set(dbg_scl)) &
801  & write(unit=ipt,nml=nml_grid_coordinates)
802 
803 
804  ! Read Groundwater Settings
805  READ(unit=nmlunit, nml=nml_groundwater,iostat=ios)
806  if(ios .NE. 0 ) then
807  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_groundwater)
808  Call fatal_error("Can Not Read NameList NML_GROUNDWATER from file: "//trim(fname))
809  end if
810 
811  rewind(nmlunit)
812 
813  if(dbg_set(dbg_scl)) &
814  & write(ipt,*) "Read_Name_List:"
815 
816  if(dbg_set(dbg_scl)) &
817  & write(unit=ipt,nml=nml_groundwater)
818 
819  ! Read LAG
820  READ(unit=nmlunit, nml=nml_lag,iostat=ios)
821  if(ios .NE. 0 ) then
822  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_lag)
823  Call fatal_error("Can Not Read NameList NML_LAG from file: "//trim(fname))
824  end if
825 
826  rewind(nmlunit)
827 
828  if(dbg_set(dbg_scl)) &
829  & write(ipt,*) "Read_Name_List:"
830 
831  if(dbg_set(dbg_scl)) &
832  & write(unit=ipt,nml=nml_lag)
833 
834 
835  ! Read Additional Models Settings
836  READ(unit=nmlunit, nml=nml_additional_models,iostat=ios)
837  if(ios .NE. 0 ) then
838  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_additional_models)
839  Call fatal_error("Can Not Read NameList NML_ADDITIONAL_MODELS from file: "//trim(fname))
840  end if
841 
842  rewind(nmlunit)
843 
844  if(dbg_set(dbg_scl)) &
845  & write(ipt,*) "Read_Name_List:"
846 
847  if(dbg_set(dbg_scl)) &
848  & write(unit=ipt,nml=nml_additional_models)
849 
850  ! Read PROBE Settings
851  READ(unit=nmlunit, nml=nml_probes,iostat=ios)
852  if(ios .NE. 0 ) then
853  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_probes)
854  Call fatal_error("Can Not Read NameList NML_PROBES from file: "//trim(fname))
855  end if
856 
857  ! Read BOUNDS CHECK (THRESHOLD SHUTDOWN) Settings
858  !=> bounds checking
859  READ(unit=nmlunit, nml=nml_boundschk,iostat=ios)
860  if(ios .NE. 0 ) then
861  if(dbg_set(dbg_log)) write(unit=ipt,nml=nml_boundschk)
862  Call fatal_error("Can Not Read NameList NML_BOUNDSCHK from file: "//trim(fname))
863  end if
864 
865 
866  rewind(nmlunit)
867 
868  if(dbg_set(dbg_scl)) &
869  & write(ipt,*) "Read_Name_List:"
870 
871  if(dbg_set(dbg_scl)) &
872  & write(unit=ipt,nml=nml_probes)
873 
874 
875  CLOSE(nmlunit)
876 
877 ! ----- END
878  if(dbg_set(dbg_sbr)) &
879  & write(ipt,*) "Subroutine Ends: Read_Name_List;"
character(len=80) casename
Definition: mod_main.f90:116
integer, parameter nmlunit
Definition: mod_main.f90:926
character(len=80) river_info_file
Definition: mod_main.f90:542
type(river), dimension(:), allocatable rivers
Definition: mod_main.f90:582
character(len=80) river_name
Definition: mod_main.f90:559
real(sp), dimension(max_layers) river_vertical_distribution
Definition: mod_main.f90:564
character(len=80) river_file
Definition: mod_main.f90:560
integer river_number
Definition: mod_main.f90:544
integer river_grid_location
Definition: mod_main.f90:561
character(len=80) input_dir
Definition: mod_main.f90:183
subroutine check_io_dirs
Definition: mod_input.f90:884
integer ipt
Definition: mod_main.f90:922
integer rivernmlunit
Definition: mod_main.f90:943
integer ios
Definition: mod_obcs2.f90:81
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nullify_file_pointers()

subroutine mod_input::nullify_file_pointers ( )

Definition at line 979 of file mod_input.f90.

979  IMPLICIT NONE
980 
981  NULLIFY(nc_dat)
982  NULLIFY(nc_avg)
983  NULLIFY(nc_rst)
984  NULLIFY(nc_start)
type(ncfile), pointer nc_avg
Definition: mod_input.f90:49
type(ncfile), pointer nc_rst
Definition: mod_input.f90:50
type(ncfile), pointer nc_dat
Definition: mod_input.f90:48
type(ncfile), pointer nc_start
Definition: mod_input.f90:51
Here is the caller graph for this function:

◆ open_coldstart()

subroutine mod_input::open_coldstart ( )

Definition at line 1156 of file mod_input.f90.

1156  USE control
1157  IMPLICIT NONE
1158  TYPE(NCFILE), POINTER :: NCF
1159  integer :: ncfileind, datfileind,ios,charnum, i
1160  logical :: fexist,back,connected
1161  character(len=100) :: testchar
1162  character(len=160) :: pathnfile
1163  character(len=2) :: cios
1164 
1165  back = .true.
1166 
1167  ! TEST FILE NAME
1168  IF(obc_on) THEN
1169  charnum = index(obc_node_list_file,".dat")
1170  if (charnum /= len_trim(obc_node_list_file)-3)&
1171  & CALL warning("OBC NODE LIST FILE does not end in .dat", &
1172  & trim(obc_node_list_file))
1173  ! OPEN FILE
1174  pathnfile = trim(input_dir)//trim(obc_node_list_file)
1175  Call fopen(obcunit,trim(pathnfile),'cfr')
1176 
1177  IF(obc_longshore_flow_on) THEN
1178  charnum = index(obc_longshore_flow_file,".dat")
1179  if (charnum /= len_trim(obc_longshore_flow_file)-3)&
1180  & CALL warning("OBC LONGSHORE FLOW FILE does not end in .dat", &
1181  & trim(obc_longshore_flow_file))
1182  ! OPEN FILE
1183  pathnfile = trim(input_dir)//trim(obc_longshore_flow_file)
1184  Call fopen(lsfunit,trim(pathnfile),'cfr')
1185  END IF
1186 
1187 
1188  END IF
1189 
1190 
1191  !Check Sigma File and open:
1192  ! TEST FILE NAME
1193  charnum = index(sigma_levels_file,".dat")
1194  if (charnum /= len_trim(sigma_levels_file)-3)&
1195  & CALL warning("SIGMA LEVELS FILE does not end in .dat", &
1196  & trim(sigma_levels_file))
1197  ! OPEN FILE
1198  pathnfile = trim(input_dir)//trim(sigma_levels_file)
1199  Call fopen(sigmaunit,trim(pathnfile),'cfr')
1200 
1201  !Check Grid File and open:
1202  ! TEST FILE NAME
1203  charnum = index(grid_file,".dat")
1204  if (charnum /= len_trim(grid_file)-3)&
1205  & CALL warning("GRID FILE does not end in .dat", &
1206  & trim(grid_file))
1207  ! OPEN FILE
1208  pathnfile = trim(input_dir)//trim(grid_file)
1209  Call fopen(gridunit,trim(pathnfile),'cfr')
1210 
1211 
1212  !Check Depth File and open:
1213  ! TEST FILE NAME
1214  charnum = index(depth_file,".dat")
1215  if (charnum /= len_trim(depth_file)-3)&
1216  & CALL warning("DEPTH FILE does not end in .dat", &
1217  & trim(depth_file))
1218  ! OPEN FILE
1219  pathnfile = trim(input_dir)//trim(depth_file)
1220  Call fopen(depthunit,trim(pathnfile),'cfr')
1221 
1222  !Check Sponge File and open:
1223  ! TEST FILE NAME
1224  charnum = index(sponge_file,".dat")
1225  if (charnum /= len_trim(sponge_file)-3)&
1226  & CALL warning("SPONGE FILE does not end in .dat", &
1227  & trim(sponge_file))
1228  ! OPEN FILE
1229  pathnfile = trim(input_dir)//trim(sponge_file)
1230  Call fopen(spongeunit,trim(pathnfile),'cfr')
1231 
1232  IF (grid_file_units == 'meters') THEN
1233  !Check Coriolis File and open:
1234  ! TEST FILE NAME
1235  charnum = index(coriolis_file,".dat")
1236  if (charnum /= len_trim(coriolis_file)-3)&
1237  & CALL warning("CORIOLIS FILE does not end in .dat", &
1238  & trim(coriolis_file))
1239  ! OPEN FILE
1240  pathnfile = trim(input_dir)//trim(coriolis_file)
1241  Call fopen(coriolisunit,trim(pathnfile),'cfr')
1242  END IF
1243 
character(len=80) coriolis_file
Definition: mod_main.f90:630
character(len=80) obc_longshore_flow_file
Definition: mod_main.f90:599
integer, parameter gridunit
Definition: mod_main.f90:929
character(len=80) depth_file
Definition: mod_main.f90:629
logical obc_on
Definition: mod_main.f90:585
character(len=80) grid_file_units
Definition: mod_main.f90:626
character(len=80) sponge_file
Definition: mod_main.f90:631
character(len=80) obc_node_list_file
Definition: mod_main.f90:586
logical obc_longshore_flow_on
Definition: mod_main.f90:598
integer, parameter depthunit
Definition: mod_main.f90:931
character(len=80) grid_file
Definition: mod_main.f90:625
integer, parameter spongeunit
Definition: mod_main.f90:933
integer, parameter sigmaunit
Definition: mod_main.f90:930
integer, parameter obcunit
Definition: mod_main.f90:928
integer, parameter coriolisunit
Definition: mod_main.f90:932
character(len=80) input_dir
Definition: mod_main.f90:183
character(len=80) sigma_levels_file
Definition: mod_main.f90:628
integer, parameter lsfunit
Definition: mod_main.f90:934
Here is the caller graph for this function:

◆ open_crashstart()

subroutine mod_input::open_crashstart ( )

Definition at line 1051 of file mod_input.f90.

1051  USE control
1052  IMPLICIT NONE
1053  TYPE(NCFILE), POINTER :: NCF
1054  integer :: ncfileind, datfileind,ios,charnum, i
1055  logical :: fexist,back,connected
1056  character(len=100) :: testchar
1057  character(len=160) :: pathnfile
1058  character(len=160) :: nextpathnfile
1059  character(len=2) :: cios
1060 
1061  Nullify(ncf)
1062 
1063  IF(rst_on) then
1064  !RESTART FILE
1065  restart_file_name = trim(casename)//"_restart_0001.nc"
1066  pathnfile= trim(output_dir)//trim(restart_file_name)
1067 
1068  CALL search_for_last_matching_name(pathnfile)
1069 
1070  ! OPEN THE FILE AND LOAD FOR STARTUP
1071  ncf => new_file()
1072  ncf%FNAME=trim(pathnfile)
1073  Call nc_open(ncf)
1074  CALL nc_load(ncf)
1075  nc_start => ncf
1076 
1077  Nullify(ncf)
1078 
1079 
1080  ! NOW CREATE ANOTHER FILE OBJECT FOR OUTPUT
1081  ! INITIALIZE TYPE TO HOLD FILE METADATA
1082  ncf => new_file()
1083  ncf%FNAME=trim(pathnfile)
1084  ncf%writable = .true.
1085  nc_rst => ncf
1086  filehead => add(filehead,ncf)
1087 
1088  END IF
1089 
1090  IF(nc_on) then
1091  ! DATA FILE
1092  nc_file_name = trim(casename)//"_0001.nc"
1093  pathnfile= trim(output_dir)//trim(nc_file_name)
1094 
1095  CALL search_for_last_matching_name(pathnfile)
1096  ncf => new_file()
1097  ncf%FNAME=trim(pathnfile)
1098  ncf%writable = .true.
1099  nc_dat => ncf
1100  filehead => add(filehead,ncf)
1101 
1102  END IF
1103 
1104 
1105  IF(ncav_on) then
1106  ! DATA FILE
1107  ncav_file_name = trim(casename)//"_avg_0001.nc"
1108  pathnfile= trim(output_dir)//trim(ncav_file_name)
1109 
1110  CALL search_for_last_matching_name(pathnfile)
1111  ncf => new_file()
1112  ncf%FNAME=trim(pathnfile)
1113  ncf%writable = .true.
1114  nc_avg => ncf
1115  filehead => add(filehead,ncf)
1116 
1117  END IF
1118 
1119 
1120 
character(len=80) casename
Definition: mod_main.f90:116
character(len=80) output_dir
Definition: mod_main.f90:184
logical nc_on
Definition: mod_main.f90:238
subroutine search_for_last_matching_name(FNAME)
Definition: mod_input.f90:1126
logical ncav_on
Definition: mod_main.f90:294
character(len=80) nc_file_name
Definition: mod_main.f90:268
type(ncfile), pointer nc_avg
Definition: mod_input.f90:49
character(len=80) ncav_file_name
Definition: mod_main.f90:324
logical rst_on
Definition: mod_main.f90:222
type(ncfile), pointer nc_rst
Definition: mod_input.f90:50
type(ncfile), pointer nc_dat
Definition: mod_input.f90:48
character(len=80) restart_file_name
Definition: mod_main.f90:227
type(ncfile), pointer nc_start
Definition: mod_input.f90:51
Here is the call graph for this function:
Here is the caller graph for this function:

◆ open_forcing()

subroutine mod_input::open_forcing ( )

Definition at line 1312 of file mod_input.f90.

1312  USE control
1313 
1314  IMPLICIT NONE
1315  TYPE(NCFILE), POINTER :: NCF
1316  integer :: ncfileind, datfileind,ios,charnum, i
1317  logical :: fexist,back,connected
1318  character(len=100) :: testchar
1319  character(len=160) :: pathnfile
1320  character(len=2) :: cios
1321 
1322  character(len=3) :: ftype
1323  integer :: fid, status
1324 
1325  back = .true.
1326 
1327  ! Check air pressure file and open
1328  if (airpressure_on .and. airpressure_kind/= cnstnt) then
1329 
1330  ! TEST FILE NAME
1331  charnum = index(airpressure_file,".nc",back)
1332  if (charnum /= len_trim(airpressure_file)-2)&
1333  & CALL warning("AIRPRESSURE FILE does not end in .nc", &
1334  & trim(airpressure_file))
1335 
1336  ! INITIALIZE TYPE TO HOLD FILE METAData
1337  pathnfile = trim(input_dir)//trim(airpressure_file)
1338  CALL nc_init(ncf,pathnfile)
1339 
1340  ! OPEN THE FILE AND LOAD METADATA
1341  If(.not. ncf%OPEN) then
1342  Call nc_open(ncf)
1343  CALL nc_load(ncf)
1344  filehead => add(filehead,ncf)
1345  end if
1346 
1347  end if
1348 
1349  ! Check wind stress file and open
1350  if (wind_on .and. wind_kind /= cnstnt) then
1351 
1352  ! TEST FILE NAME
1353  charnum = index(wind_file,".nc",back)
1354  if (charnum /= len_trim(wind_file)-2)&
1355  & CALL warning("WIND FILE does not end in .nc", &
1356  & trim(wind_file))
1357 
1358  ! INITIALIZE TYPE TO HOLD FILE METAData
1359  pathnfile = trim(input_dir)//trim(wind_file)
1360  CALL nc_init(ncf,pathnfile)
1361 
1362  ! OPEN THE FILE AND LOAD METADATA
1363  If(.not. ncf%OPEN) then
1364  Call nc_open(ncf)
1365  CALL nc_load(ncf)
1366  filehead => add(filehead,ncf)
1367  end if
1368 
1369  end if
1370 
1371  ! Check Heat file and open
1372  if (heating_on .and. heating_kind /= cnstnt) then
1373 
1374  ! TEST FILE NAME
1375  charnum = index(heating_file,".nc",back)
1376  if (charnum /= len_trim(heating_file)-2)&
1377  & CALL warning("HEATING FILE does not end in .nc", &
1378  & trim(heating_file))
1379 
1380  ! INITIALIZE TYPE TO HOLD FILE METADATA
1381  pathnfile= trim(input_dir)//trim(heating_file)
1382  CALL nc_init(ncf,pathnfile)
1383 
1384  ! OPEN THE FILE AND LOAD METADATA
1385  if(.not. ncf%OPEN) then
1386  Call nc_open(ncf)
1387  CALL nc_load(ncf)
1388 
1389  filehead => add(filehead,ncf)
1390  end if
1391 
1392  end if
1393 
1394 
1395 
1396  ! Check Precip file and open
1397  if (precipitation_on .and. precipitation_kind /= cnstnt) then
1398 
1399  ! TEST FILE NAME
1400  charnum = index(precipitation_file,".nc",back)
1401  if (charnum /= len_trim(precipitation_file)-2)&
1402  & CALL warning("PRECIPITATION FILE does not end in .nc", &
1403  & trim(precipitation_file))
1404 
1405  ! INITIALIZE TYPE TO HOLD FILE METADATA
1406  pathnfile= trim(input_dir)//trim(precipitation_file)
1407  CALL nc_init(ncf,pathnfile)
1408 
1409  ! OPEN THE FILE AND LOAD METADATA
1410  if(.not. ncf%OPEN) then
1411  Call nc_open(ncf)
1412  CALL nc_load(ncf)
1413  filehead => add(filehead,ncf)
1414  end if
1415  end if
1416 
1417  ! Check Wave file and open
1418  if (wave_on .and. wave_kind /= cnstnt) then
1419 
1420  ! TEST FILE NAME
1421  charnum = index(wave_file,".nc",back)
1422  if (charnum /= len_trim(wave_file)-2)&
1423  & CALL warning("WAVE FILE does not end in .nc", &
1424  & trim(wave_file))
1425 
1426  ! INITIALIZE TYPE TO HOLD FILE METADATA
1427  pathnfile= trim(input_dir)//trim(wave_file)
1428  CALL nc_init(ncf,pathnfile)
1429 
1430  ! OPEN THE FILE AND LOAD METADATA
1431  if(.not. ncf%OPEN) then
1432  Call nc_open(ncf)
1433  CALL nc_load(ncf)
1434  filehead => add(filehead,ncf)
1435  end if
1436  end if
1437 
1438 
1439 
1440 
1441  !Check RIVER files and open
1442 
1443  do i =1, river_number
1444 
1445  ! TEST FILE NAME
1446  charnum = index(rivers(i)%FILE,".nc",back)
1447  if (charnum /= len_trim(rivers(i)%FILE)-2)&
1448  & CALL warning("RIVER FILE does not end in .nc", &
1449  & trim(rivers(i)%FILE))
1450 
1451  ! INITIALIZE TYPE TO HOLD FILE METADATA
1452  pathnfile= trim(input_dir)//trim(rivers(i)%FILE)
1453  CALL nc_init(ncf,pathnfile)
1454 
1455  ! OPEN THE FILE AND LOAD METADATA IF NOT ALREADY DONE
1456  if(.not. ncf%OPEN) then
1457  Call nc_open(ncf)
1458  CALL nc_load(ncf)
1459  filehead => add(filehead,ncf)
1460  end if
1461 
1462  end do
1463 
1464 
1465  !Check OBC files and open:
1466 
1467  if (obc_on) then
1468 
1469  IF(obc_elevation_forcing_on) THEN
1470 
1471  ! Determine file type:
1472  pathnfile= trim(input_dir)//trim(obc_elevation_file)
1473 
1474 
1475  ! TRY opening file as a netcdf file
1476  IF(dbg_set(dbg_log))write(ipt,*) "! Trying to open Boundary Forcing file: "//trim(obc_elevation_file)
1477 
1478  status = nf90_open(trim(pathnfile), nf90_nowrite, fid)
1479  if(status == nf90_noerr) then
1480  status = nf90_close(fid)
1481 
1482  IF(dbg_set(dbg_log))write(ipt,*) "! Open Boundary Forcing file is a NETCDF FILE"
1483 
1484  ! INITIALIZE TYPE TO HOLD FILE METADATA
1485  CALL nc_init(ncf,pathnfile)
1486 
1487  ! OPEN THE FILE AND LOAD METADATA
1488  if(.not. ncf%OPEN) then
1489  Call nc_open(ncf)
1490  CALL nc_load(ncf)
1491  filehead => add(filehead,ncf)
1492  end if
1493  else
1494 
1495  IF(dbg_set(dbg_log)) write(ipt,*) "! Open Boundary Forcing file is not a NETCDF file"
1496  IF(msr) THEN
1497 
1498  Call fopen(julobcunit,trim(pathnfile),'cfr')
1499 
1500  write(ipt,*) "! Open Boundary Forcing file is an ASCII file"
1501  END IF
1502 
1503  ! INITIALIZE DUMMY FILE TYPE FOR ASCII FILE
1504  ncf => new_file(pathnfile)
1505  ncf => add(ncf,nc_make_att("type","ASCII FILE DUMMY ATTRIBUTE"))
1506  filehead => add(filehead,ncf)
1507 
1508  end if
1509 
1510  END IF
1511 
1512 
1513  if (obc_temp_nudging) then
1514 
1515  ! TEST FILE NAME
1516  charnum = index(obc_temp_file,".nc",back)
1517  if (charnum /= len_trim(obc_temp_file)-2)&
1518  & CALL warning("OBC TEMP FILE does not end in .nc", &
1519  & trim(obc_temp_file))
1520 
1521  ! INITIALIZE TYPE TO HOLD FILE METADATA
1522  pathnfile= trim(input_dir)//trim(obc_temp_file)
1523  CALL nc_init(ncf,pathnfile)
1524 
1525  ! OPEN THE FILE AND LOAD METADATA
1526  if(.not. ncf%OPEN)then
1527  Call nc_open(ncf)
1528  CALL nc_load(ncf)
1529  filehead => add(filehead,ncf)
1530  end if
1531  end if
1532 
1533  if (obc_salt_nudging) then
1534 
1535  ! TEST FILE NAME
1536  charnum = index(obc_salt_file,".nc",back)
1537  if (charnum /= len_trim(obc_salt_file)-2)&
1538  & CALL warning("OBC SALT FILE does not end in .nc", &
1539  & trim(obc_salt_file))
1540 
1541  ! INITIALIZE TYPE TO HOLD FILE METADATA
1542  pathnfile= trim(input_dir)//trim(obc_salt_file)
1543  CALL nc_init(ncf,pathnfile)
1544 
1545  ! OPEN THE FILE AND LOAD METADATA
1546  if(.not. ncf%OPEN) then
1547  Call nc_open(ncf)
1548  CALL nc_load(ncf)
1549  filehead => add(filehead,ncf)
1550  end if
1551  end if
1552 
1553  if (obc_meanflow) then
1554 
1555  ! TEST FILE NAME
1556  charnum = index(obc_meanflow_file,".nc",back)
1557  if (charnum /= len_trim(obc_meanflow_file)-2)&
1558  & CALL warning("OBC MEANFLOW FILE does not end in .nc", &
1559  & trim(obc_meanflow_file))
1560 
1561  ! INITIALIZE TYPE TO HOLD FILE METADATA
1562  pathnfile= trim(input_dir)//trim(obc_meanflow_file)
1563  CALL nc_init(ncf,pathnfile)
1564 
1565  ! OPEN THE FILE AND LOAD METADATA
1566  if(.not. ncf%OPEN) then
1567  Call nc_open(ncf)
1568  CALL nc_load(ncf)
1569  filehead => add(filehead,ncf)
1570  end if
1571  end if
1572 
1573 
1574  end if
1575 
1576 
1577  !Check Ground Water File and open:
1578  if (groundwater_on .and. groundwater_kind /= cnstnt) then
1579 
1580  ! TEST FILE NAME
1581  charnum = index(groundwater_file,".nc",back)
1582  if (charnum /= len_trim(groundwater_file)-2)&
1583  & CALL warning("GROUNDWATER FILE does not end in .nc", &
1584  & trim(groundwater_file))
1585 
1586  ! INITIALIZE TYPE TO HOLD FILE METADATA
1587  pathnfile= trim(input_dir)//trim(groundwater_file)
1588  CALL nc_init(ncf,pathnfile)
1589 
1590  ! OPEN THE FILE AND LOAD METADATA
1591  if(.not. ncf%OPEN) then
1592  Call nc_open(ncf)
1593  CALL nc_load(ncf)
1594  filehead => add(filehead,ncf)
1595  end if
1596  end if
1597 
1598 
1599  IF (icing_model .and. icing_forcing_kind /= cnstnt) THEN
1600 
1601  ! TEST FILE NAME
1602  charnum = index(icing_forcing_file,".nc",back)
1603  if (charnum /= len_trim(icing_forcing_file)-2)&
1604  & CALL warning("ICING MODEL FILE does not end in .nc", &
1605  & trim(icing_forcing_file))
1606 
1607  ! INITIALIZE TYPE TO HOLD FILE METADATA
1608  pathnfile= trim(input_dir)//trim(icing_forcing_file)
1609  CALL nc_init(ncf,pathnfile)
1610 
1611  ! OPEN THE FILE AND LOAD METADATA
1612  if(.not. ncf%OPEN) then
1613  Call nc_open(ncf)
1614  CALL nc_load(ncf)
1615  filehead => add(filehead,ncf)
1616  end if
1617 
1618  END IF
1619 
1620  IF (ice_model .and. ice_forcing_kind /= cnstnt) THEN
1621 
1622  ! TEST FILE NAME
1623  charnum = index(ice_forcing_file,".nc",back)
1624  if (charnum /= len_trim(ice_forcing_file)-2)&
1625  & CALL warning("ICE MODEL FILE does not end in .nc", &
1626  & trim(ice_forcing_file))
1627 
1628  ! INITIALIZE TYPE TO HOLD FILE METADATA
1629  pathnfile= trim(input_dir)//trim(ice_forcing_file)
1630  CALL nc_init(ncf,pathnfile)
1631 
1632  ! OPEN THE FILE AND LOAD METADATA
1633  if(.not. ncf%OPEN) then
1634  Call nc_open(ncf)
1635  CALL nc_load(ncf)
1636  filehead => add(filehead,ncf)
1637  end if
1638 
1639  END IF
1640 
1641  ! LOAD HORIZONTAL MIXING FILE
1642  IF (horizontal_mixing_kind /= cnstnt) THEN
1643 
1644  ! TEST FILE NAME
1645  charnum = index(horizontal_mixing_file,".nc",back)
1646  if (charnum /= len_trim(horizontal_mixing_file)-2)&
1647  & CALL warning("Horizontal Mixing File does not end in .nc", &
1648  & trim(horizontal_mixing_file))
1649 
1650  ! INITIALIZE TYPE TO HOLD FILE METADATA
1651  pathnfile= trim(input_dir)//trim(horizontal_mixing_file)
1652  CALL nc_init(ncf,pathnfile)
1653 
1654  ! OPEN THE FILE AND LOAD METADATA
1655  if(.not. ncf%OPEN) then
1656  Call nc_open(ncf)
1657  CALL nc_load(ncf)
1658  filehead => add(filehead,ncf)
1659  end if
1660 
1661  END IF
1662 
1663 
1664  ! LOAD BOTTOM ROUGHNESS LENGTH SCALE
1665  IF (bottom_roughness_kind /= cnstnt) THEN
1666 
1667  ! TEST FILE NAME
1668  charnum = index(bottom_roughness_file,".nc",back)
1669  if (charnum /= len_trim(bottom_roughness_file)-2)&
1670  & CALL warning("Bottom Roughness File does not end in .nc", &
1671  & trim(bottom_roughness_file))
1672 
1673  ! INITIALIZE TYPE TO HOLD FILE METADATA
1674  pathnfile= trim(input_dir)//trim(bottom_roughness_file)
1675  CALL nc_init(ncf,pathnfile)
1676 
1677  ! OPEN THE FILE AND LOAD METADATA
1678  if(.not. ncf%OPEN) then
1679  Call nc_open(ncf)
1680  CALL nc_load(ncf)
1681  filehead => add(filehead,ncf)
1682  end if
1683 
1684  END IF
1685 
1686 
character(len=80) wave_kind
Definition: mod_main.f90:479
character(len=80) airpressure_kind
Definition: mod_main.f90:474
character(len=80) icing_forcing_file
Definition: mod_main.f90:720
logical obc_temp_nudging
Definition: mod_main.f90:590
logical msr
Definition: mod_main.f90:101
logical obc_salt_nudging
Definition: mod_main.f90:593
character(len=80) precipitation_kind
Definition: mod_main.f90:468
character(len=80) heating_file
Definition: mod_main.f90:452
type(river), dimension(:), allocatable rivers
Definition: mod_main.f90:582
integer, parameter julobcunit
Definition: mod_main.f90:938
logical obc_on
Definition: mod_main.f90:585
character(len=80) obc_temp_file
Definition: mod_main.f90:591
character(len=80) wave_file
Definition: mod_main.f90:478
character(len=80) precipitation_file
Definition: mod_main.f90:467
logical obc_meanflow
Definition: mod_main.f90:596
character(len=80) horizontal_mixing_kind
Definition: mod_main.f90:353
logical obc_elevation_forcing_on
Definition: mod_main.f90:587
character(len=80) icing_forcing_kind
Definition: mod_main.f90:721
character(len=80) ice_forcing_kind
Definition: mod_main.f90:727
integer river_number
Definition: mod_main.f90:544
character(len=80) groundwater_file
Definition: mod_main.f90:651
logical precipitation_on
Definition: mod_main.f90:466
logical wave_on
Definition: mod_main.f90:477
logical ice_model
Definition: mod_main.f90:725
character(len=80) heating_kind
Definition: mod_main.f90:453
character(len=80) ice_forcing_file
Definition: mod_main.f90:726
character(len=80) obc_meanflow_file
Definition: mod_main.f90:597
character(len=80) groundwater_kind
Definition: mod_main.f90:650
character(len=80) wind_kind
Definition: mod_main.f90:446
logical groundwater_on
Definition: mod_main.f90:649
logical airpressure_on
Definition: mod_main.f90:472
logical icing_model
Definition: mod_main.f90:719
character(len=80), parameter cnstnt
Definition: mod_main.f90:488
logical wind_on
Definition: mod_main.f90:443
character(len=80) input_dir
Definition: mod_main.f90:183
character(len=80) horizontal_mixing_file
Definition: mod_main.f90:352
logical heating_on
Definition: mod_main.f90:450
character(len=80) airpressure_file
Definition: mod_main.f90:473
integer ipt
Definition: mod_main.f90:922
character(len=80) bottom_roughness_file
Definition: mod_main.f90:370
character(len=80) obc_elevation_file
Definition: mod_main.f90:588
character(len=80) obc_salt_file
Definition: mod_main.f90:594
character(len=80) wind_file
Definition: mod_main.f90:445
character(len=80) bottom_roughness_kind
Definition: mod_main.f90:368
Here is the caller graph for this function:

◆ open_new_output()

subroutine mod_input::open_new_output ( )

Definition at line 1247 of file mod_input.f90.

1247  USE control
1248  IMPLICIT NONE
1249  TYPE(NCFILE), POINTER :: NCF
1250  integer :: ncfileind, datfileind,ios,charnum, i
1251  logical :: fexist,back,connected
1252  character(len=100) :: testchar
1253  character(len=160) :: pathnfile
1254  character(len=2) :: cios
1255 
1256 
1257  back = .true.
1258  ! SETUP AND CREATE DATA OUTPUT FILES!
1259  IF(nc_on) THEN
1260  nc_file_name = trim(casename)//"_0001.nc"
1261  pathnfile = trim(output_dir)//trim(nc_file_name)
1262  CALL nc_init(ncf,pathnfile)
1263  if(msr) then
1264  CALL nc_create(ncf)
1265  CALL nc_close(ncf)
1266  else
1267  ncf%writable = .true.
1268  end if
1269 
1270  nc_dat => ncf
1271 
1272  filehead => add(filehead,ncf)
1273 
1274  END IF
1275 
1276  IF(ncav_on) THEN
1277  ncav_file_name = trim(casename)//"_avg_0001.nc"
1278  pathnfile = trim(output_dir)//trim(ncav_file_name)
1279  CALL nc_init(ncf,pathnfile)
1280  if(msr) then
1281  CALL nc_create(ncf)
1282  CALL nc_close(ncf)
1283  else
1284  ncf%writable = .true.
1285  end if
1286 
1287  nc_avg => ncf
1288 
1289  filehead => add(filehead,ncf)
1290  END IF
1291 
1292 
1293  if(rst_on) then
1294  restart_file_name = trim(casename)//"_restart_0001.nc"
1295  pathnfile = trim(output_dir)//trim(restart_file_name)
1296  CALL nc_init(ncf,pathnfile)
1297  if(msr) then
1298  CALL nc_create(ncf)
1299  CALL nc_close(ncf)
1300  else
1301  ncf%writable = .true.
1302  end if
1303 
1304  nc_rst => ncf
1305 
1306  filehead => add(filehead,ncf)
1307  end if
1308 
character(len=80) casename
Definition: mod_main.f90:116
logical msr
Definition: mod_main.f90:101
character(len=80) output_dir
Definition: mod_main.f90:184
logical nc_on
Definition: mod_main.f90:238
logical ncav_on
Definition: mod_main.f90:294
character(len=80) nc_file_name
Definition: mod_main.f90:268
type(ncfile), pointer nc_avg
Definition: mod_input.f90:49
character(len=80) ncav_file_name
Definition: mod_main.f90:324
logical rst_on
Definition: mod_main.f90:222
type(ncfile), pointer nc_rst
Definition: mod_input.f90:50
type(ncfile), pointer nc_dat
Definition: mod_input.f90:48
character(len=80) restart_file_name
Definition: mod_main.f90:227
Here is the caller graph for this function:

◆ open_startup_file()

subroutine mod_input::open_startup_file ( )

Definition at line 1019 of file mod_input.f90.

1019  USE control
1020  IMPLICIT NONE
1021  TYPE(NCFILE), POINTER :: NCF
1022  integer :: ncfileind, datfileind,ios,charnum, i
1023  logical :: fexist,back,connected
1024  character(len=100) :: testchar
1025  character(len=160) :: pathnfile
1026  character(len=2) :: cios
1027  ! CHECK FOR INPUT AND OUTPUT DIRECTORIES
1028 
1029  back = .true.
1030 
1031  ! TEST FILE NAME
1032  charnum = index(startup_file,".nc",back)
1033  if (charnum /= len_trim(startup_file)-2)&
1034  & CALL warning("STARUP FILE NAME does not end in .nc", &
1035  & trim(startup_file))
1036 
1037  ! INITIALIZE TYPE TO HOLD FILE METADATA
1038  pathnfile= trim(input_dir)//trim(startup_file)
1039 
1040  ncf => new_file()
1041  ncf%FNAME=trim(pathnfile)
1042 
1043  Call nc_open(ncf)
1044  CALL nc_load(ncf)
1045 
1046  nc_start => ncf
1047 
character(len=80) startup_file
Definition: mod_main.f90:142
character(len=80) input_dir
Definition: mod_main.f90:183
type(ncfile), pointer nc_start
Definition: mod_input.f90:51
Here is the caller graph for this function:

◆ parse_tide()

subroutine mod_input::parse_tide ( character(len=*)  line,
integer  cnt,
integer  ntc,
real(sp), dimension(:,:), allocatable  data,
integer  ierr 
)

Definition at line 2922 of file mod_input.f90.

2922  implicit none
2923 
2924  CHARACTER(LEN=*) :: line
2925  Integer :: cnt, ntc, ierr
2926  Real(sp), allocatable :: data(:,:)
2927 
2928  CHARACTER(LEN=20), allocatable :: item(:) !Automatically deallocate on exit!
2929  CHARACTER(LEN=80) :: TEST
2930  INTEGER :: I, VAL, J
2931  LOGICAL :: ISFLOAT
2932 
2933  ! If the string is empty
2934  ierr = -1
2935  IF(len_trim(line)<=1) return
2936 
2937  CALL split_string(line," ",item)
2938 
2939  val = read_int(item(1),ierr)
2940  IF(ierr /= 0) RETURN
2941 
2942 
2943  cnt = cnt + 1
2944 
2945  IF(cnt >SIZE(DATA,1)) CALL fatal_error&
2946  &("THERE IS A MISTAKE IN THE NON JULIAN TIDAL FORCING INPUT FILE",&
2947  & "THERE ARE MORE BOUNDARY POINTS LISTED THAN THE STATED NUMBER?",&
2948  & "Line :"//trim(line))
2949 
2950  IF(val /= cnt) CALL fatal_error&
2951  &("THERE IS A MISTAKE IN THE NON JULIAN TIDAL FORCING INPUT FILE",&
2952  & "THE LIST OF BOUNDARY POINTS IS OUT OF ORDER OR CAN NOT BE READ?",&
2953  & "Line :"//trim(line))
2954 
2955 
2956  ! NOW READ THE DATA
2957  DO j = 1, ntc
2958 
2959  IF(j+1 > SIZE(item)) CALL fatal_error&
2960  &("INVALID LINE IN NON JULIAN TIDAL FORCING FILE",&
2961  & "Incorrect number of tidal compontents",&
2962  & "Line: "//trim(line))
2963 
2964  DATA(cnt,j) = read_float(item(j+1),ierr)
2965  if(ierr/=0)CALL fatal_error&
2966  &("INVALID DATA IN ASCII NON_JULIAN FORCING FILE",&
2967  & "Non Floating Point Value: '"//item(j+1)//"' ; in li&
2968  &ne: "//trim(line))
2969 
2970  END DO
2971 
2972 
2973  ! SUCCESS
2974  ierr = 0
2975 
Here is the caller graph for this function:

◆ read_coldstart_coords()

subroutine mod_input::read_coldstart_coords ( integer, intent(in)  GRIDUNIT,
integer, intent(in)  MGL,
real(sp), dimension(:), allocatable  XG2,
real(sp), dimension(:), allocatable  YG2 
)

Definition at line 3284 of file mod_input.f90.

3284 ! USE ALL_VARS !Jadon Ge
3285  IMPLICIT NONE
3286  INTEGER, INTENT(IN) :: MGL
3287  INTEGER, INTENT(IN) :: GRIDUNIT
3288  REAL(SP), ALLOCATABLE :: XG2(:),YG2(:)
3289  CHARACTER(LEN=80) :: temp
3290  INTEGER :: I,LM1,J,IOS,LMAX,CellCount,NodeCount
3291  INTEGER :: N1, N2, N3, ISCAN
3292  real(SP) :: X1, Y1
3293  !==============================================================================|
3294 
3295  ! DO NOT REWIND - SAVED LOCATION FROM READING CONNECTIVITY
3296  i =0
3297  DO WHILE (.true.)
3298 
3299  READ(gridunit,*,iostat=ios)j,x1,y1
3300  IF(ios<0) exit
3301 
3302  i = i + 1
3303  IF(i > mgl) THEN
3304  write(ipt,*) "Read ", i, "; lines of coordiante data with out reaching EOF?"
3305  CALL fatal_error('Number of rows of data in the grid file coordinates exceeds the stated number of nodes ?')
3306  END IF
3307 
3308 
3309  xg2(i) = x1
3310  yg2(i) = y1
3311  END DO
3312 
3313  if( i .NE. mgl) THEN
3314  write(ipt,*) "Read, ", i, "rows of data but mgl= ",mgl
3315  CALL fatal_error('Number of rows of data in the grid file coordinates does not equal the stated number of nodes ?')
3316  END if
3317 
3318  if(dbg_set(dbg_log)) then
3319  WRITE(ipt,*)'! Finished Reading coordinates from Grid File'
3320  WRITE(ipt,*)'! Max/Min(X) = :',maxval(xg2(1:mgl)),minval(xg2(1:mgl))
3321  WRITE(ipt,*)'! Max/Min(Y) = :',maxval(yg2(1:mgl)),minval(yg2(1:mgl))
3322  WRITE(ipt,*)'!'
3323  end if
3324 
integer, parameter gridunit
Definition: mod_main.f90:929
integer mgl
Definition: mod_main.f90:50
integer ipt
Definition: mod_main.f90:922
integer ios
Definition: mod_obcs2.f90:81
Here is the caller graph for this function:

◆ read_coldstart_coriolis()

subroutine mod_input::read_coldstart_coriolis ( integer, intent(in)  CORIOLISUNIT,
integer, intent(in)  MGL,
real(sp), dimension(:), intent(in), allocatable  XG,
real(sp), dimension(:), intent(in), allocatable  YG,
real(sp), dimension(:), allocatable  CORG 
)

Definition at line 3437 of file mod_input.f90.

3437  IMPLICIT NONE
3438  INTEGER, INTENT(IN) :: CORIOLISUNIT, MGL
3439  REAL(SP),ALLOCATABLE,INTENT(IN) :: XG(:),YG(:)
3440  REAL(SP),ALLOCATABLE ::CORG(:)
3441  CHARACTER(LEN=80) :: INPLINE,temp,xchr,ychr
3442  INTEGER :: I,J,IOS,NodeCount,ISCAN
3443  Real(sp) :: X1, Y1, C1,DiffxMax,DiffyMax
3444  logical :: test
3445  !==============================================================================|
3446  test=.false.
3447  diffxmax=0.0_sp
3448  diffymax=0.0_sp
3449  !
3450  !----------------Determine Number of Nodes -------------------------------!
3451 
3452  iscan = scan_file(coriolisunit,"Node Number",iscal = nodecount)
3453  IF(iscan /= 0) then
3454  write(temp,'(I2)') iscan
3455  call fatal_error('Improper formatting of CORIOLIS FILE: ISCAN ERROR&
3456  &# '//trim(temp),&
3457  & 'The header must contain: "Node Number = "', &
3458  & 'Followed by an integer number of nodes')
3459  END IF
3460 
3461  if ( nodecount .NE. mgl) &
3462  & CALL fatal_error('The stated number of nodes in the coriolis file',&
3463  ' does not match the number in the gird file')
3464 
3465 !----------------Read Depth Array----------------------------------!
3466 !
3467 
3468  ! FIND FIRST LINE of CORIOLIS DATA
3469  rewind coriolisunit
3470  DO WHILE(.true.)
3471  READ(coriolisunit,*,iostat=ios,end=99)x1,y1,c1
3472  if (ios == 0) then
3473  backspace coriolisunit
3474  exit
3475  end if
3476 
3477  cycle
3478 99 Call fatal_error('Improper formatting of CORIOLIS FILE:',&
3479  &'Reached end of file with out finding CORIOLIS data?',&
3480  &'FORMAT: X Y COR (ALL REALS)')
3481  END DO
3482 
3483  ! READ IN CORIOLIS DATA
3484 
3485  i = 0
3486  DO WHILE(.true.)
3487 
3488  READ(coriolisunit,*,iostat=ios) x1,y1,c1
3489  IF(ios < 0) exit
3490 
3491  i = i + 1
3492  IF(i > mgl) CALL fatal_error('Number of rows of data in the Coriolis file &
3493  &exceeds the number of nodes ?')
3494 
3495 
3496  ! THIS SHOULD SCREEN OUT MOST ROUNDOFF ERRORS
3497  IF (xg(i) .NE. x1 .or. yg(i) .NE. y1) then
3498 
3499  test=.true.
3500  diffxmax=max(diffxmax,abs(xg(i)-x1))
3501  diffymax=max(diffymax,abs(yg(i)-y1))
3502 
3503 !!$ UNCOMMNET FOR STRICT MATCHING
3504 !!$ write(temp,'(I8)') I
3505 !!$ Call FATAL_ERROR('Grid Coordinates do not match between the&
3506 !!$ & grid file and the coriolis file','The bad value occurs&
3507 !!$ & at Node Number: '//trim(temp))
3508 
3509 
3510  END IF
3511 
3512  corg(i)=c1
3513  END DO
3514 
3515  WRITE(xchr,*)diffxmax
3516  WRITE(ychr,*)diffymax
3517  IF(test) CALL warning("THE GRID FILE AND CORIOLIS FILE COORDINATES DO NOT MATCH EXACTLY",&
3518  & "LARGEST DIFFERENCE IN X-COORDINATE:"//trim(xchr),&
3519  & "LARGEST DIFFERENCE IN Y-COORDINATE:"//trim(ychr),&
3520  & "See mod_input.F::READ_COLDSTART_CORIOLIS for details")
3521 
3522  if ( i .NE. mgl) &
3523  & CALL fatal_error('The number of rows of data in the coriolis file does&
3524  & not equal the number of nodes?')
3525 
3526  if(dbg_set(dbg_log)) then
3527  WRITE(ipt,*)'! Finished Reading Coriolis File'
3528  WRITE(ipt,*)'! Max Coriolis = :',maxval(corg(1:mgl))
3529  WRITE(ipt,*)'! Min Coriolis = :',minval(corg(1:mgl))
3530  WRITE(ipt,*)'!'
3531  end if
3532 
3533 
integer mgl
Definition: mod_main.f90:50
integer, parameter coriolisunit
Definition: mod_main.f90:932
integer ipt
Definition: mod_main.f90:922
integer ios
Definition: mod_obcs2.f90:81
Here is the caller graph for this function:

◆ read_coldstart_depth()

subroutine mod_input::read_coldstart_depth ( integer, intent(in)  DEPTHUNIT,
integer, intent(in)  MGL,
real(sp), dimension(:), intent(in), allocatable  XG2,
real(sp), dimension(:), intent(in), allocatable  YG2,
real(sp), dimension(:), allocatable  HG2 
)

Definition at line 3329 of file mod_input.f90.

3329 ! USE ALL_VARS !Jadon Ge
3330  IMPLICIT NONE
3331  INTEGER, INTENT(IN) :: DEPTHUNIT, MGL
3332  REAL(SP),ALLOCATABLE,INTENT(IN) :: XG2(:),YG2(:)
3333  REAL(SP),ALLOCATABLE ::HG2(:)
3334  CHARACTER(LEN=80) :: temp,XCHR,YCHR
3335  INTEGER :: I,J,IOS,NodeCount, ISCAN
3336  Real(sp) :: X1, Y1, HDEP,DiffxMax,DiffyMax
3337  logical :: back, test
3338  !==============================================================================|
3339  test=.false.
3340  diffxmax=0.0_sp
3341  diffymax=0.0_sp
3342  !
3343  !----------------Determine Number of Nodes -------------------------------!
3344 
3345  iscan = scan_file(depthunit,"Node Number",iscal = nodecount)
3346  IF(iscan /= 0) then
3347  write(temp,'(I2)') iscan
3348  call fatal_error('Improper formatting of DEPTH FILE: ISCAN ERROR&
3349  &# '//trim(temp),&
3350  & 'The header must contain: "Node Number ="', &
3351  & 'Followed by an integer number of nodes')
3352  END IF
3353 
3354  if ( nodecount .NE. mgl) &
3355  & CALL fatal_error('The stated number of nodes in the depth file',&
3356  ' does not match the number in the grid file')
3357 
3358 
3359 
3360 !----------------Read Depth Array----------------------------------!
3361 !
3362 
3363  ! FIND FIRST LINE of CONNECTIVITY ARRAY
3364  rewind depthunit
3365  DO WHILE(.true.)
3366  READ(depthunit,*,iostat=ios,end=99)x1,y1,hdep
3367  if (ios == 0) then
3368  backspace depthunit
3369  exit
3370  end if
3371 
3372  cycle
3373 
3374 99 Call fatal_error('Improper formatting of DEPTH FILE:',&
3375  &'Reached end of file with out finding DEPTH data?',&
3376  &'FORMAT: X Y H (ALL REALS)')
3377 
3378  END DO
3379 
3380  i = 0
3381  DO WHILE(.true.)
3382 
3383  READ(depthunit,*,iostat=ios) x1,y1,hdep
3384  IF(ios < 0) exit
3385 
3386  i = i + 1
3387  IF(i > mgl) CALL fatal_error('Number of rows of data in the depth file &
3388  &exceeds the number of nodes ?')
3389 
3390 
3391  ! THIS SHOULD SCREEN OUT MOST ROUNDOFF ERRORS
3392  IF (xg2(i) .NE. x1 .or. yg2(i) .NE. y1) then
3393  test = .true.
3394 
3395  diffxmax=max(diffxmax,abs(xg2(i)-x1))
3396  diffymax=max(diffymax,abs(yg2(i)-y1))
3397 
3398 !!$ UNCOMMNET FOR STRICT MATCHING
3399 !!$ write(temp,'(I8)') I
3400 !!$ Call FATAL_ERROR('Grid Coordinates do not match between the&
3401 !!$ & grid file and the depth file','The bad value occurs&
3402 !!$ & at Node Number: '//trim(temp))
3403 
3404  END IF
3405 
3406  hg2(i)=hdep
3407  END DO
3408 
3409  WRITE(xchr,*)diffxmax
3410  WRITE(ychr,*)diffymax
3411 
3412  IF(test) CALL warning("THE GRID FILE AND DEPTH FILE COORDINATES DO NOT MATCH EXACTLY",&
3413  & "LARGEST DIFFERENCE IN X-COORDINATE:"//trim(xchr),&
3414  & "LARGEST DIFFERENCE IN Y-COORDINATE:"//trim(ychr),&
3415  & "See mod_input.F::READ_COLDSTART_DEPTH for details")
3416 
3417  if ( i .NE. mgl) &
3418  & CALL fatal_error('The number of rows of data in the depth file does&
3419  & not equal the number of nodes?')
3420 
3421  if(dbg_set(dbg_log)) then
3422  WRITE(ipt,*)'! Finished Reading DEPTH File'
3423  WRITE(ipt,*)'! Max DEPTH = :',maxval(hg2(1:mgl))
3424  WRITE(ipt,*)'! Min DEPTH = :',minval(hg2(1:mgl))
3425  WRITE(ipt,*)'!'
3426  end if
3427 
3428 !%# if defined (DATA_ASSIM_OI)
3429 ! Jadon Ge added for the HG support in mod_assim_io.F
3430 ! ALLOCATE(HG(0:MGL)) ; HG = 0.0_SP
3431 !% HG(1:MGL) = HG2(1:MGL)
3432 !%# endif
3433 
integer, parameter depthunit
Definition: mod_main.f90:931
integer mgl
Definition: mod_main.f90:50
integer ipt
Definition: mod_main.f90:922
integer ios
Definition: mod_obcs2.f90:81
Here is the caller graph for this function:

◆ read_coldstart_grid()

subroutine mod_input::read_coldstart_grid ( integer, intent(in)  GRIDUNIT,
integer, intent(out)  MGL,
integer, intent(out)  NGL,
integer, dimension(:,:), allocatable  NVG 
)

Definition at line 2980 of file mod_input.f90.

2980  IMPLICIT NONE
2981  INTEGER, INTENT(OUT) :: NGL, MGL
2982  INTEGER, INTENT(IN) :: GRIDUNIT
2983  INTEGER, ALLOCATABLE :: NVG(:,:)
2984  CHARACTER(LEN=80) :: temp
2985  INTEGER :: I,LM1,J,IOS,LMAX,CellCount,NodeCount
2986  INTEGER :: N1, N2, N3, ISCAN,K
2987  INTEGER :: SENDER,nvals, IERR, STATUS
2988  real(SP) :: X1, Y1
2989  !----------------Determine Number of Nodes -------------------------------!
2990  iscan = scan_file(gridunit,"Node Number",iscal = mgl)
2991  IF(iscan /= 0) then
2992  write(temp,'(I2)') iscan
2993  call fatal_error('Improper formatting of GRID FILE: ISCAN ERROR&
2994  &# '//trim(temp),&
2995  & 'The header must contain: "Node Number = "', &
2996  & 'Followed by an integer number of Nodes')
2997  END IF
2998  !----------------Determine Number of Elements -------------------------------!
2999 
3000  iscan = scan_file(gridunit,"Cell Number",iscal = ngl)
3001  IF(iscan /= 0)then
3002  write(temp,'(I2)') iscan
3003  call fatal_error('Improper formatting of GRID FILE: ISCAN ERROR&
3004  &#'//trim(temp),&
3005  & 'The header must contain: "Cell Number = "', &
3006  & 'Followed by an integer number of Cells.')
3007 
3008  END IF
3009 !----------------Read Connectivity Array----------------------------------!
3010 !
3011 
3012  ! FIND FIRST LINE of CONNECTIVITY ARRAY
3013  rewind gridunit
3014  DO WHILE(.true.)
3015  READ(gridunit,*,iostat=ios,end=99)j,n1,n2,n3
3016  if (ios == 0) then
3017  backspace gridunit
3018  exit
3019  end if
3020 
3021  cycle
3022 
3023 99 Call fatal_error('Improper formatting of GRID FILE:',&
3024  &'Reached end of file with out finding CONNECTIVITY data?',&
3025  &'FORMAT: CELL# NODE# NODE# NODE# (ALL INTEGERS)')
3026 
3027  END DO
3028 
3029  ! READ IN CONNECTIVITY
3030 
3031  ALLOCATE(nvg(0:ngl,4)); nvg=0
3032  j = 0
3033  i = 1
3034  lm1=1
3035  DO WHILE(.true.)
3036 
3037  READ(gridunit,*,iostat=ios)j,n1,n2,n3
3038  IF(ios < 0) CALL fatal_error('ERROR READING GRID FILE CONNECTIV&
3039  &ITY LIST')
3040 
3041 
3042  IF(j == 1 .AND. lm1 /= 1)THEN
3043  cellcount = lm1
3044  backspace gridunit
3045 
3046  READ(gridunit,*) j
3047  IF(j .GT. 0) THEN
3048  DO k=1,j
3049  backspace gridunit
3050  END DO
3051  EXIT
3052  ELSE
3053  CALL warning('Trouble reading grid file!')
3054 
3055  EXIT
3056  END IF
3057  END IF
3058 
3059 
3060  IF(i > ngl) CALL fatal_error &
3061  &('Number of rows of data in the grid file CONNECTIVITY data exceeds the stated number of Cells ?')
3062 
3063  ! LIST IS REORDERD!
3064  nvg(i,1)=n1
3065  nvg(i,2)=n3
3066  nvg(i,3)=n2
3067  nvg(i,4)=n1
3068 
3069 
3070  i = i + 1
3071  lm1 = j
3072  END DO
3073 
3074  if ( cellcount .NE. ngl) CALL fatal_error&
3075  ('The number of rows of data in the grid file CONNECTIVITY does not equal the stated number?')
3076 
3077  nodecount = max(maxval(nvg(:,1)), maxval(nvg(:,2)), maxval(nvg(:,3)))
3078  if ( nodecount .NE. mgl) &
3079  & CALL fatal_error('The number of nodes in the grid file CONNECTIVITY does not equal the stated number ?')
3080 
3081 
3082  if(dbg_set(dbg_log)) then
3083  WRITE(ipt,*)'! Finished Reading Grid File'
3084  WRITE(ipt,*)'! # OF NODES :',mgl
3085  WRITE(ipt,*)'! # OF CELLS :',ngl
3086  WRITE(ipt,*)'!'
3087  end if
3088 
integer, parameter gridunit
Definition: mod_main.f90:929
integer mgl
Definition: mod_main.f90:50
integer ipt
Definition: mod_main.f90:922
integer ios
Definition: mod_obcs2.f90:81
integer ngl
Definition: mod_main.f90:49
Here is the caller graph for this function:

◆ read_coldstart_lsf()

subroutine mod_input::read_coldstart_lsf ( integer, intent(in)  LSFUNIT,
integer, intent(out)  N_GL,
integer, dimension(:), intent(out), allocatable  I_GL,
real(sp), dimension(:), intent(out), allocatable  GEO_GL,
real(sp), dimension(:), intent(out), allocatable  WDF_GL 
)

Definition at line 3194 of file mod_input.f90.

3194  IMPLICIT NONE
3195  INTEGER, INTENT(IN) :: LSFUNIT
3196  INTEGER, INTENT(OUT) :: N_GL
3197  INTEGER, INTENT(OUT), Allocatable :: I_GL(:)
3198  REAL(SP), INTENT(OUT), Allocatable :: GEO_GL(:),WDF_GL(:)
3199  CHARACTER(LEN=80) :: temp,temp2
3200  INTEGER :: I,J,IOS,NodeCount,ISCAN
3201  INTEGER :: N1, N2, N3, N4
3202  REAL(SP) :: R1, R2
3203  !==============================================================================|
3204 
3205  !
3206  !----------------Determine Number of Nodes -------------------------------!
3207 
3208  iscan = scan_file(lsfunit,"Longshore Flow Node Number",iscal = n_gl)
3209  IF(iscan /= 0) then
3210  write(temp,'(I2)') iscan
3211  call fatal_error('Improper formatting of LONGSHORE FLOW FILE: ISCAN ERROR&
3212  &# '//trim(temp),&
3213  & 'The header must contain: "Longshre Flow Node Number ="', &
3214  & 'Followed by an integer number of nodes')
3215  END IF
3216 
3217 
3218  if(n_gl==0) then
3219 
3220  if(dbg_set(dbg_log)) then
3221  WRITE(ipt,*)'! Finished Reading LSF file: No Long Shore Flow Nodes!'
3222  WRITE(ipt,*)'! LSF NODES = :',n_gl
3223  WRITE(ipt,*)'!'
3224  end if
3225  return
3226  end if
3227 
3228 !----------------Read OBC Array----------------------------------!
3229 !
3230  ! FIND FIRST LINE of )BC ARRAY
3231  rewind lsfunit
3232  DO WHILE(.true.)
3233  READ(lsfunit,*,iostat=ios,end=99)n1,n2,r1,r2
3234  if (ios == 0) then
3235  backspace lsfunit
3236  exit
3237  end if
3238 
3239  cycle
3240 
3241 99 Call fatal_error('Improper formatting of LongShore Flow FILE:',&
3242  &'Reached end of file with out finding LSF data?',&
3243  &'FORMAT: LSFNODE# GLNODE# GEO WND (last two are real 0<=X<=1)')
3244 
3245  END DO
3246  ALLOCATE(i_gl(n_gl))
3247  ALLOCATE(geo_gl(n_gl))
3248  ALLOCATE(wdf_gl(n_gl))
3249 
3250 
3251  i = 0
3252  DO WHILE(.true.)
3253 
3254  READ(lsfunit,*,iostat=ios) n1,n2,r1,r2
3255  IF(ios < 0) exit
3256 
3257  i = i + 1
3258  IF(i > n_gl) CALL fatal_error('Number of rows of data in the LongShore Flow file &
3259  &exceeds the stated number of boundary nodes in the header ?')
3260 
3261 
3262  i_gl(i) = n2
3263  geo_gl(i) = r1
3264  wdf_gl(i) = r2
3265 
3266  END DO
3267 
3268  if ( i .NE. n_gl) &
3269  & CALL fatal_error('The number of rows of data in the LONGSHORE FLOW file does&
3270  & not equal the number of nodes in the header?')
3271 
3272 
3273  if(dbg_set(dbg_log)) then
3274  WRITE(ipt,*)'! Finished Reading LSF File'
3275  WRITE(ipt,*)'! LSF NODES = :',n_gl
3276  WRITE(ipt,*)'!'
3277  end if
3278 
3279 
integer ipt
Definition: mod_main.f90:922
integer ios
Definition: mod_obcs2.f90:81
integer, parameter lsfunit
Definition: mod_main.f90:934
Here is the caller graph for this function:

◆ read_coldstart_obc_grid()

subroutine mod_input::read_coldstart_obc_grid ( integer, intent(in)  OBCUNIT,
integer, intent(in)  MGL,
integer, intent(out)  IOBCN_GL,
integer, dimension(:), intent(out), allocatable  I_OBC_GL,
integer, dimension(:), intent(out), allocatable  TYPE_OBC_GL 
)

Definition at line 3093 of file mod_input.f90.

3093  IMPLICIT NONE
3094  INTEGER, INTENT(IN) :: OBCUNIT, MGL
3095  INTEGER, INTENT(OUT) :: IOBCN_GL
3096  INTEGER, INTENT(OUT), Allocatable :: I_OBC_GL(:), TYPE_OBC_GL(:)
3097  CHARACTER(LEN=80) :: temp,temp2
3098  INTEGER :: I,J,IOS,NodeCount,ISCAN
3099  INTEGER :: N1, N2, N3
3100  !==============================================================================|
3101 
3102  !
3103  !----------------Determine Number of Nodes -------------------------------!
3104 
3105  iscan = scan_file(obcunit,"OBC Node Number",iscal = iobcn_gl)
3106  IF(iscan /= 0) then
3107  write(temp,'(I2)') iscan
3108  call fatal_error('Improper formatting of OBC FILE: ISCAN ERROR&
3109  &# '//trim(temp),&
3110  & 'The header must contain: "OBC Node Number ="', &
3111  & 'Followed by an integer number of boundary nodes')
3112  END IF
3113 
3114 
3115  if(iobcn_gl==0) then
3116 
3117  if(dbg_set(dbg_log)) then
3118  WRITE(ipt,*)'! Finished Reading OBC File: NO OPEN BOUNDARY'
3119  WRITE(ipt,*)'! OBC NODES = :',iobcn_gl
3120  WRITE(ipt,*)'!'
3121  end if
3122  return
3123  end if
3124 
3125 !----------------Read OBC Array----------------------------------!
3126 !
3127  ! FIND FIRST LINE of )BC ARRAY
3128  rewind obcunit
3129  DO WHILE(.true.)
3130  READ(obcunit,*,iostat=ios,end=99)n1,n2,n3
3131  if (ios == 0) then
3132  backspace obcunit
3133  exit
3134  end if
3135 
3136  cycle
3137 
3138 99 Call fatal_error('Improper formatting of OBC FILE:',&
3139  &'Reached end of file with out finding OBC data?',&
3140  &'FORMAT: OBCNODE# GLNODE# TYPE# (ALL INTEGERS)')
3141 
3142  END DO
3143  ALLOCATE(i_obc_gl(iobcn_gl))
3144  ALLOCATE(type_obc_gl(iobcn_gl))
3145 
3146 
3147  i = 0
3148  DO WHILE(.true.)
3149 
3150  READ(obcunit,*,iostat=ios) n1,n2,n3
3151  IF(ios < 0) exit
3152 
3153  i = i + 1
3154  IF(i > iobcn_gl) CALL fatal_error('Number of rows of data in the OBC file &
3155  &exceeds the stated number of boundary nodes in the header ?')
3156 
3157  IF( 1 > n2 .or. n2 > mgl) then
3158  write(temp,'(I8)') i
3159  write(temp2,'(I8)') mgl
3160  CALL fatal_error('OPEN BOUNDARY NODE NUMBER'//trim(temp)//&
3161  & 'IS NOT IN THE GLOBAL DOMAIN',&
3162  & 'CHECK INPUT FILE AND ENSURE OPEN BOUNDARY NODES <= '//trim(temp2))
3163  END IF
3164 
3165  IF( 1 > n3 .or. n3 > 10) then
3166  write(temp,'(I8)') i
3167  CALL fatal_error('OPEN BOUNDARY NODE NUMBER'//trim(temp)//&
3168  & ' IS NOT IN THE VALID RANGE',&
3169  & 'THE OPEN BOUNDARY NODE TYPE MUST BE GREATER THAN 0',&
3170  & 'AND LESS THAN 11. SEE MOD_OBC.F FOR DESCRIPTION')
3171  END IF
3172 
3173 
3174  i_obc_gl(i) = n2
3175  type_obc_gl(i) = n3
3176 
3177  END DO
3178 
3179  if ( i .NE. iobcn_gl) &
3180  & CALL fatal_error('The number of rows of data in the OBC file does&
3181  & not equal the number of nodes in the header?')
3182 
3183 
3184  if(dbg_set(dbg_log)) then
3185  WRITE(ipt,*)'! Finished Reading OBC File'
3186  WRITE(ipt,*)'! OBC NODES = :',iobcn_gl
3187  WRITE(ipt,*)'!'
3188  end if
3189 
3190 
integer, dimension(:), allocatable i_obc_gl
Definition: mod_main.f90:1773
integer mgl
Definition: mod_main.f90:50
integer, dimension(:), allocatable type_obc_gl
Definition: mod_main.f90:1782
integer, parameter obcunit
Definition: mod_main.f90:928
integer iobcn_gl
Definition: mod_main.f90:1775
integer ipt
Definition: mod_main.f90:922
integer ios
Definition: mod_obcs2.f90:81
Here is the caller graph for this function:

◆ read_coldstart_sigma()

subroutine mod_input::read_coldstart_sigma ( )

Definition at line 3639 of file mod_input.f90.

3639  USE control ! Several variables for sigma coords!
3640  IMPLICIT NONE
3641  CHARACTER(LEN=80) :: INPLINE,temp,temp2
3642  INTEGER :: I,J,IOS,NodeCount, ISCAN
3643  INTEGER :: N1, N2, N3
3644 
3645  !==============================================================================|
3646 
3647  ! Get data from Sigma file for the following variables - depends
3648  ! on coordinate type, some may not exist!
3649 
3650  ! GET SIGMA COORDINATE TYPE
3651  iscan = scan_file(sigmaunit,"NUMBER OF SIGMA LEVELS",iscal = kb)
3652  IF(iscan /= 0) then
3653  write(temp,'(I2)') iscan
3654  call fatal_error('Improper formatting of SIGMA FILE: ISCAN ERROR&
3655  &# '//trim(temp),&
3656  & 'The header must contain: "NUMBER OF SIGMA LEVELS"', &
3657  & 'Followed by an integer number of levels.')
3658  END IF
3659 
3660 
3661  ! GET SIGMA COORDINATE TYPE
3662  iscan = scan_file(sigmaunit,"SIGMA COORDINATE TYPE",cval = stype)
3663  IF(iscan /= 0) then
3664  write(temp,'(I2)') iscan
3665  call fatal_error('Improper formatting of SIGMA FILE: ISCAN ERROR&
3666  &# '//trim(temp),&
3667  & 'The header must contain: "SIGMA COORDINATE TYPE"', &
3668  & 'Followed by one of four defined types:',&
3669  & '"UNIFORM" or "GEOMETRIC" or "TANH" or "GENERALIZED" ')
3670  END IF
3671 
3672  ! SELECT CASE BASED ON SIGMA COORDINATE TYPE
3673  select case(trim(stype))
3674 ! DEGENERATE CASE OF GEOMETRIC SIGMA COORDINATES - UNIFROM DISTRIBUTION
3675  case(trim(stype_uniform))
3676  p_sigma = 1.0
3677  if(dbg_set(dbg_log)) then
3678  WRITE(ipt,*)'! Finished Reading SIGMA File'
3679  WRITE(ipt,*)'! SIGMA COORDINATE TYPE = : '//trim(stype)
3680  WRITE(ipt,*)'! P_SIGMA (UNIFORM) = : ',p_sigma
3681  WRITE(ipt,*)'! # OF SIGMA LEVELS(KB) = : ',kb
3682  WRITE(ipt,*)'!'
3683  end if
3684 
3685 ! GEOMETRIC SIGMA COORDINATES- P_SIGMA = 2 => Quadratic distribution
3686  case(trim(stype_geometric))
3687 
3688  iscan = scan_file(sigmaunit,"SIGMA POWER",fscal = p_sigma)
3689  IF(iscan /= 0) then
3690  write(temp,'(I2)') iscan
3691  call fatal_error('Improper formatting of SIGMA FILE: ISCAN ERROR&
3692  &# '//trim(temp),&
3693  & 'For GEOMETRIC SIGMA COORDINATE TYPE', &
3694  & 'The header must conatain "SIGMA POWER"',&
3695  & 'Followed by a real value (1.0 is uniform sigma coordinates)')
3696  END IF
3697 
3698 
3699  if(dbg_set(dbg_log)) then
3700  WRITE(ipt,*)'! Finished Reading SIGMA File'
3701  WRITE(ipt,*)'! SIGMA COORDINATE TYPE = : '//trim(stype)
3702  WRITE(ipt,*)'! P_SIGMA = : ',p_sigma
3703  WRITE(ipt,*)'! # OF SIGMA LEVELS(KB) = : ',kb
3704  WRITE(ipt,*)'!'
3705  end if
3706 
3707 ! HYPERBOLIC TANGENT DISTRIBUTION OF SURFACE AND BOTTOM INTESIFIED LAYERS
3708  case(trim(stype_tanh))
3709 
3710  iscan = scan_file(sigmaunit,"DU",fscal = du2)
3711  IF(iscan /= 0) then
3712  write(temp,'(I2)') iscan
3713  call fatal_error('Improper formatting of SIGMA FILE: ISCAN ERROR&
3714  &# '//trim(temp),&
3715  & 'For TANH SIGMA COORDINATE TYPE', &
3716  & 'The header must conatain "DU"',&
3717  & 'Followed by a real value (See set_sigma.F')
3718  END IF
3719 
3720  iscan = scan_file(sigmaunit,"DL",fscal = dl2)
3721  IF(iscan /= 0) then
3722  write(temp,'(I2)') iscan
3723  call fatal_error('Improper formatting of SIGMA FILE: ISCAN ERROR&
3724  &# '//trim(temp),&
3725  & 'For TANH SIGMA COORDINATE TYPE', &
3726  & 'The header must conatain "DL"',&
3727  & 'Followed by a real value (See set_sigma.F')
3728  END IF
3729 
3730  if(dbg_set(dbg_log)) then
3731  WRITE(ipt,*)'! Finished Reading SIGMA File'
3732  WRITE(ipt,*)'! SIGMA COORDINATE TYPE = : '//trim(stype)
3733  WRITE(ipt,*)'! # OF SIGMA LEVELS(KB) = : ',kb
3734  WRITE(ipt,*)'! DU = : ',du2
3735  WRITE(ipt,*)'! DL = : ',dl2
3736  WRITE(ipt,*)'!'
3737  end if
3738 
3739 ! A SPATIALLY DEPENDENT DISTRIBUTION OF LAYER THICKNESS BASED ON DEPTH
3740  case(trim(stype_generalized))
3741 
3742  iscan = scan_file(sigmaunit,"DU",fscal = duu)
3743  IF(iscan /= 0) then
3744  write(temp,'(I2)') iscan
3745  call fatal_error('Improper formatting of SIGMA FILE: ISCAN ERROR&
3746  &# '//trim(temp),&
3747  & 'For GENERALIZED SIGMA COORDINATE TYPE', &
3748  & 'The header must conatain "DU"',&
3749  & 'Followed by a real value (See set_sigma.F')
3750  END IF
3751 
3752  iscan = scan_file(sigmaunit,"DL",fscal = dll)
3753  IF(iscan /= 0) then
3754  write(temp,'(I2)') iscan
3755  call fatal_error('Improper formatting of SIGMA FILE: ISCAN ERROR&
3756  &# '//trim(temp),&
3757  & 'For GENERALIZED SIGMA COORDINATE TYPE', &
3758  & 'The header must conatain "DL"',&
3759  & 'Followed by a real value (See set_sigma.F')
3760  END IF
3761 
3762  iscan = scan_file(sigmaunit,"MIN CONSTANT DEPTH",fscal = hmin1)
3763  IF(iscan /= 0) then
3764  write(temp,'(I2)') iscan
3765  call fatal_error('Improper formatting of SIGMA FILE: ISCAN ERROR&
3766  &# '//trim(temp),&
3767  & 'For GENERALIZED SIGMA COORDINATE TYPE', &
3768  & 'The header must conatain "MIN CONSTANT DEPTH"',&
3769  & 'Followed by a real value (See set_sigma.F')
3770  END IF
3771 
3772  iscan = scan_file(sigmaunit,"KU",iscal = ku)
3773  IF(iscan /= 0) then
3774  write(temp,'(I2)') iscan
3775  call fatal_error('Improper formatting of SIGMA FILE: ISCAN ERROR&
3776  &# '//trim(temp),&
3777  & 'For GENERALIZED SIGMA COORDINATE TYPE', &
3778  & 'The header must conatain "KU"',&
3779  & 'Followed by a real value (See set_sigma.F')
3780  END IF
3781 
3782  iscan = scan_file(sigmaunit,"KL",iscal = kl)
3783  IF(iscan /= 0) then
3784  write(temp,'(I2)') iscan
3785  call fatal_error('Improper formatting of SIGMA FILE: ISCAN ERROR&
3786  &# '//trim(temp),&
3787  & 'For GENERALIZED SIGMA COORDINATE TYPE', &
3788  & 'The header must conatain "KL"',&
3789  & 'Followed by a real value (See set_sigma.F')
3790  END IF
3791 
3792 !------------------------------------------------------------------------------|
3793 ! "ZKU" !!
3794 !------------------------------------------------------------------------------|
3795  IF(ku .ge. 1 .and. ku .LE. 150)THEN
3796 
3797  ALLOCATE(zku(ku)); zku=0.0_sp
3798  iscan = scan_file(sigmaunit,"ZKU",fvec = zku ,nsze = n1)
3799  IF(iscan /= 0) then
3800  write(temp,'(I2)') iscan
3801  call fatal_error('Improper formatting of SIGMA FILE: ISCAN ERROR&
3802  &# '//trim(temp),&
3803  & 'For GENERALIZED SIGMA COORDINATE TYPE', &
3804  & 'The header must conatain "ZKU"',&
3805  & 'Followed by a real values (See set_sigma.F')
3806  END IF
3807 
3808 
3809  IF(n1 /= ku)THEN
3810  call fatal_error('Improper formatting of SIGMA FILE:',&
3811  & 'For GENERALIZED SIGMA COORDINATE TYPE', &
3812  & 'THE NUMBER OF SPECIFIED DEPTHS IN ZKU IS NOT EQUAL TO KU')
3813  END IF
3814 
3815 
3816 
3817  ELSE IF( ku .NE. 0) THEN
3818  call fatal_error('Improper formatting of SIGMA FILE:',&
3819  & 'For GENERALIZED SIGMA COORDINATE TYPE', &
3820  & 'Requirement: 1<= KL <= 150;')
3821 
3822  END IF
3823 !------------------------------------------------------------------------------|
3824 ! "ZKL" !!
3825 !--------------------------------------------------------------------
3826  IF(kl .ge. 1 .and. kl .LE. 150)THEN
3827 
3828  ALLOCATE(zkl(kl)); zkl=0.0_sp
3829  iscan = scan_file(sigmaunit,"ZKL",fvec = zkl ,nsze = n1)
3830  IF(iscan /= 0) then
3831  write(temp,'(I2)') iscan
3832  call fatal_error('Improper formatting of SIGMA FILE: ISCAN ERROR&
3833  &# '//trim(temp),&
3834  & 'For GENERALIZED SIGMA COORDINATE TYPE', &
3835  & 'The header must conatain "ZKL"',&
3836  & 'Followed by a real values (See set_sigma.F')
3837  END IF
3838 
3839 
3840  IF(n1 /= kl)THEN
3841  call fatal_error('Improper formatting of SIGMA FILE:',&
3842  & 'For GENERALIZED SIGMA COORDINATE TYPE', &
3843  & 'THE NUMBER OF SPECIFIED DEPTHS IN ZKL IS NOT EQUAL TO KL')
3844  END IF
3845 
3846  ELSE IF (kl .NE. 0) THEN
3847  call fatal_error('Improper formatting of SIGMA FILE:',&
3848  & 'For GENERALIZED SIGMA COORDINATE TYPE', &
3849  & 'Requirement: 1<= KL <= 150;')
3850 
3851  END IF
3852 
3853  ! END GET VARIABLES
3854 
3855  if(dbg_set(dbg_log)) then
3856  WRITE(ipt,*)'! Finished Reading SIGMA File'
3857  WRITE(ipt,*)'! SIGMA COORDINATE TYPE = : '//trim(stype)
3858  WRITE(ipt,*)'! # OF SIGMA LEVELS(KB) = : ',kb
3859  WRITE(ipt,*)'! DU = : ',duu
3860  WRITE(ipt,*)'! DL = : ',dll
3861  WRITE(ipt,*)'! MIN CONSTANT DEPTH = : ',hmin1
3862  WRITE(ipt,*)'! KU = : ',ku
3863  WRITE(ipt,*)'! KL = : ',kl
3864  WRITE(ipt,*)'!'
3865  end if
3866 
3867 
3868 
3869 case default
3870  call fatal_error('Improper formatting of SIGMA FILE',&
3871  & 'Allowed SIGMA COORDINATE TYPEs are:',&
3872  & '"UNIFORM" or "GEOMETRIC" or "TANH" or "GENERALIZED"',&
3873  & 'See Set_Sigma.F for a description')
3874  end select
3875 
3876 
integer kl
Definition: mod_main.f90:912
real(sp) hmin1
Definition: mod_main.f90:909
character(len=80), parameter stype_uniform
Definition: mod_main.f90:894
integer kb
Definition: mod_main.f90:64
real(sp), dimension(:), allocatable zkl
Definition: mod_main.f90:915
real(sp), dimension(:), allocatable zku
Definition: mod_main.f90:914
integer, parameter sigmaunit
Definition: mod_main.f90:930
real(sp) duu
Definition: mod_main.f90:907
real(sp) p_sigma
Definition: mod_main.f90:900
character(len=80), parameter stype_geometric
Definition: mod_main.f90:895
character(len=80), parameter stype_tanh
Definition: mod_main.f90:896
integer ipt
Definition: mod_main.f90:922
real(sp) dll
Definition: mod_main.f90:908
integer ku
Definition: mod_main.f90:911
character(len=80) stype
Definition: mod_main.f90:893
real(sp) du2
Definition: mod_main.f90:903
character(len=80), parameter stype_generalized
Definition: mod_main.f90:897
real(sp) dl2
Definition: mod_main.f90:904
Here is the caller graph for this function:

◆ read_coldstart_sponge()

subroutine mod_input::read_coldstart_sponge ( integer, intent(in)  SPONGEUNIT,
integer, intent(in)  MGL,
integer, intent(out)  NSPONGE,
integer, dimension(:), intent(out), allocatable  N_SPG,
real(sp), dimension(:), intent(out), allocatable  R_SPG,
real(sp), dimension(:), intent(out), allocatable  C_SPG 
)

Definition at line 3539 of file mod_input.f90.

3539  IMPLICIT NONE
3540  REAL(SP), INTENT(OUT), ALLOCATABLE :: R_SPG(:),C_SPG(:)
3541  INTEGER, INTENT(OUT), ALLOCATABLE :: N_SPG(:)
3542  INTEGER, INTENT(IN) :: SPONGEUNIT,MGL
3543  INTEGER, INTENT(OUT) :: NSPONGE
3544  CHARACTER(LEN=80) :: temp,temp2
3545  INTEGER :: I,J,IOS,NodeCount,ISCAN
3546  INTEGER :: N1
3547  REAL(SP) :: R1,R2
3548  !==============================================================================|
3549 
3550  !
3551  !----------------Determine Number of Nodes -------------------------------
3552 
3553  iscan = scan_file(spongeunit,"Sponge Node Number",iscal = nsponge)
3554  IF(iscan /= 0) then
3555  write(temp,'(I2)') iscan
3556  call fatal_error('Improper formatting of SPONGE FILE: ISCAN ERROR&
3557  &# '//trim(temp),&
3558  & 'The header must contain: "Sponge Node Number ="', &
3559  & 'Followed by an integer number of nodes where the sponge&
3560  & value is set')
3561  END IF
3562 
3563 !----------------Read SPONGE Array----------------------------------!
3564 !
3565 
3566  if(nsponge==0) then
3567  if(dbg_set(dbg_log)) then
3568  WRITE(ipt,*)'! Finished Reading SPONGE File: NO SPONGE NODES'
3569  WRITE(ipt,*)'! SPONGE NODES =',nsponge
3570  WRITE(ipt,*)'!'
3571  end if
3572  return
3573  end if
3574 
3575 
3576 
3577  ! FIND FIRST LINE of )BC ARRAY
3578  rewind spongeunit
3579  DO WHILE(.true.)
3580  READ(spongeunit,*,iostat=ios,end=99)n1,r1,r2
3581  if (ios == 0) then
3582  backspace spongeunit
3583  exit
3584  end if
3585 
3586  cycle
3587 
3588 99 Call fatal_error('Improper formatting of SPONGE FILE:',&
3589  &'Reached end of file with out finding sponge data?',&
3590  &'FORMAT: GLBNODE# RADIUS SPGVAL (INT, REAL, REAL)')
3591 
3592  END DO
3593 
3594  ALLOCATE(n_spg(nsponge)); n_spg = 0
3595  ALLOCATE(r_spg(nsponge)); r_spg = 0.0
3596  ALLOCATE(c_spg(nsponge)); c_spg = 0.0
3597 
3598 
3599 
3600  i = 0
3601  DO WHILE(.true.)
3602 
3603  READ(spongeunit,*,iostat=ios) n1,r1,r2
3604  IF(ios < 0) exit
3605 
3606  i = i + 1
3607  IF(i > nsponge) CALL fatal_error('Number of rows of data in the SPONGE file &
3608  &exceeds the stated number in the header ?')
3609 
3610  IF( 1 > n1 .or. n1 > mgl) then
3611  write(temp,'(I8)') i
3612  write(temp2,'(I8)') mgl
3613  CALL fatal_error('SPONGE NODE NUMBER'//trim(temp)//&
3614  & 'IS NOT IN THE GLOBAL DOMAIN',&
3615  & 'CHECK INPUT FILE AND ENSURE SPONGE NODE# is <= '//trim(temp2))
3616  END IF
3617  n_spg(i) = n1
3618  r_spg(i) = r1
3619  c_spg(i) = r2
3620 
3621  END DO
3622 
3623  if ( i .NE. nsponge) &
3624  & CALL fatal_error('The number of rows of data in the sponge file does&
3625  & not equal the number of nodes in the header?')
3626 
3627  if(dbg_set(dbg_log)) then
3628  WRITE(ipt,*)'! Finished Reading Sponge File'
3629  WRITE(ipt,*)'! SPONGE NODES = :',nsponge
3630  WRITE(ipt,*)'!'
3631  end if
3632 
3633 
3634 
integer nsponge
Definition: mod_setup.f90:66
real(sp), dimension(:), allocatable, target c_spg
Definition: mod_setup.f90:65
real(sp), dimension(:), allocatable, target r_spg
Definition: mod_setup.f90:65
integer, parameter spongeunit
Definition: mod_main.f90:933
integer, dimension(:), allocatable, target n_spg
Definition: mod_setup.f90:64
integer mgl
Definition: mod_main.f90:50
integer ipt
Definition: mod_main.f90:922
integer ios
Definition: mod_obcs2.f90:81
Here is the caller graph for this function:

◆ read_julian_obc()

subroutine mod_input::read_julian_obc ( integer, intent(in)  JULOBCUNIT_TEMP,
integer, intent(out)  NTC,
character(len=*), dimension(:), intent(out), allocatable  NAMES,
real(sp), dimension(:), intent(out), allocatable  PRD,
real(sp), dimension(:), intent(out), allocatable  EQ_AMP,
real(sp), dimension(:), intent(out), allocatable  EQ_BETA,
character(len=*), dimension(:), intent(out), allocatable  EQ_TYPE,
real(sp), dimension(:,:), intent(out), allocatable  MPTD,
real(sp), dimension(:,:), intent(out), allocatable  PHS,
real(sp), dimension(:), intent(out), allocatable  RF,
type(time), intent(out)  TORG 
)

Definition at line 2621 of file mod_input.f90.

2621  USE control
2622  IMPLICIT NONE
2623  INTEGER, INTENT(IN) :: JULOBCUNIT_TEMP
2624  INTEGER,INTENT(OUT) :: NTC ! Number of Tidal Components
2625  REAL(SP),INTENT(OUT), ALLOCATABLE :: PRD(:) ! Tidal Period
2626  REAL(SP),INTENT(OUT), ALLOCATABLE :: EQ_AMP(:) ! Equilibrium Amplitude
2627  REAL(SP),INTENT(OUT), ALLOCATABLE :: EQ_BETA(:) ! Equilibrium Beta
2628  CHARACTER(LEN=*),INTENT(OUT),ALLOCATABLE :: EQ_TYPE(:) ! Equilibrium Type
2629  REAL(SP),INTENT(OUT), ALLOCATABLE :: MPTD(:,:) ! Amplitude
2630  REAL(SP),INTENT(OUT), ALLOCATABLE :: PHS(:,:)! Phase
2631  REAL(SP),INTENT(OUT), ALLOCATABLE :: RF(:) ! Reference Height
2632  CHARACTER(LEN=*),INTENT(OUT), ALLOCATABLE :: Names(:) ! Name of Components
2633  TYPE(TIME),INTENT(OUT) :: TORG
2634 
2635  REAL(DP) :: TORGDP
2636 
2637  REAL(SP), ALLOCATABLE :: RFTMP(:,:) ! Dummy REF
2638  INTEGER :: ISCAN, I, MYOBC, IOS, CNT, J
2639  CHARACTER(LEN=80) :: Iserr,COMPN
2640 
2641  CHARACTER(LEN=80) :: line
2642  CHARACTER(LEN=500) :: long_line
2643  CHARACTER(LEN=20), allocatable :: item(:)
2644  CHARACTER(LEN=80) :: TEST
2645 
2646  CHARACTER(LEN=80), Parameter :: line_amp = "Amplitude"
2647  CHARACTER(LEN=80), Parameter :: line_pha = "Phase"
2648  CHARACTER(LEN=80), Parameter :: line_ref = "Eref"
2649 
2650  LOGICAL :: ISFLOAT
2651 
2652  if(dbg_set(dbg_io)) WRITE(ipt,*) "! READING NON-JULIAN TIDAL FORCING FILE"
2653 
2654  iscan = scan_file(julobcunit_temp,"Tidal Component Number",iscal = ntc)
2655  IF(iscan /= 0) then
2656  write(iserr,'(I2)') iscan
2657  call fatal_error('Improper formatting of Non-Julian Tidal Forcing File: ISCAN ERROR&
2658  &# '//trim(iserr),&
2659  & 'The header must contain: "Tidal Component Number = "', &
2660  & 'Followed by an integer number')
2661  END IF
2662 
2663 
2664  if(dbg_set(dbg_io)) write(ipt,*) "Tidal Component Number", ntc
2665 
2666 
2667  ALLOCATE(prd(ntc))
2668  ALLOCATE(names(ntc))
2669  ALLOCATE(eq_amp(0))
2670  ALLOCATE(eq_beta(0))
2671  ALLOCATE(eq_type(0))
2672 
2673  DO i = 1,ntc
2674 
2675  !write(COMPN,'(I)') I
2676  write(compn,*) i
2677  compn= adjustl(compn)
2678  iscan = scan_file(julobcunit_temp,trim(compn),cval = line)
2679  IF(iscan /= 0) then
2680  write(iserr,'(I2)') iscan
2681  call fatal_error('Improper formatting of Non-Julian Tidal Forcing File: ISCAN ERROR&
2682  &# '//trim(iserr),&
2683  & 'The header must contain: "'//trim(compn)//' = "', &
2684  & 'Followed by: Name,Period,Eq. Amp.*, Eq. Beta*, Type*')
2685  END IF
2686 
2687  CALL split_string(line," ",item)
2688 
2689  IF(SIZE(item) >= 2) THEN
2690 
2691  ! GET THE NAME OF THE COMPONENT
2692  names(i) = trim(item(1))
2693 
2694  ! GET THE PERIOD OF THE COMPONENT
2695  prd(i) = read_float(item(2), ios)
2696  ! -------- new: Karsten Lettmann, 2016, march -------
2697  ! initialize Test:
2698  test = item(2)
2699  ! -------------- end new ----------------------------
2700  IF(ios /=0) CALL fatal_error&
2701  &("INVALID DATA IN ASCII NON_JULIAN FORCING FILE",&
2702  & "Non Floating Point Value: '"//trim(test)//"' ; in line: "//trim(line))
2703 
2704  ELSE
2705  CALL fatal_error&
2706  & ("Improper Line in Non Julian Tidal forcing file:",&
2707  & "Line :"//trim(line),&
2708  & "The Tidal Component section must conatin:",&
2709  & "Component# = Name, Period")
2710  END IF
2711 
2712  DEALLOCATE(item)
2713 
2714  END DO
2715 
2716  ! GET THE TIME ORIGIN
2717  iscan = scan_file(julobcunit_temp,"Time Origin",cval = line)
2718  IF(iscan /= 0) then
2719  write(iserr,'(I2)') iscan
2720  call fatal_error('Improper formatting of Non-Julian Tidal Forcing File: ISCAN ERROR&
2721  &# '//trim(iserr),&
2722  & 'The header must contain: "Time Origin = "', &
2723  & 'Followed by a data or time')
2724  END IF
2725 
2726  IF (use_real_world_time) THEN
2727 
2728  torg = read_datetime(line,date_format,timezone,ios)
2729  IF(ios == 0) Call fatal_error&
2730  &("NON JULIAN TIDAL FORCING FILE - Time Origin error"&
2731  &"Could not read the date string Time Origin",&
2732  & "The model is running using real dates")
2733 
2734  if(dbg_set(dbg_io)) CALL print_real_time(torg,ipt,"NON JULIAN T0")
2735 
2736  ELSE
2737 
2738  CALL split_string(line," ",item)
2739 
2740  IF (size(item)>1 ) THEN
2741  torgdp = read_float(item(1),ios)
2742  IF(ios /=0) CALL fatal_error&
2743  & ("NON JULIAN TIDAL FORCING FILE - Time Origin error",&
2744  & "Could not read the floating point number",&
2745  & "Line :"//trim(line),&
2746  & "The model is running using ideal time (starting from 0.0)")
2747  ELSE
2748  CALL fatal_error&
2749  &("NON JULIAN TIDAL FORCING FILE - Time Origin error",&
2750  & "Could not read the string Time Origin",&
2751  & "Line :"//trim(line),&
2752  & "The model is running using ideal time (starting from 0.0)")
2753  END IF
2754 
2755  IF(item(2)=="seconds") THEN
2756  torg = seconds2time(torgdp)
2757  ELSEIF(item(2)=="days" .and. size(item)>1 ) THEN
2758  torg = days2time(torgdp)
2759  ELSE
2760  CALL fatal_error&
2761  &("NON JULIAN TIDAL FORCING FILE - Time Origin error",&
2762  & "Could not read the string Time Origin",&
2763  & "The model is running using ideal time (starting from 0.0)")
2764  END IF
2765 
2766  if(dbg_set(dbg_io)) CALL print_time(torg,ipt,"NON JULIAN T0")
2767 
2768 
2769  END IF
2770 
2771  iscan = scan_file(julobcunit_temp,"OBC Node Number",iscal = myobc)
2772  IF(iscan /= 0) then
2773  write(iserr,'(I2)') iscan
2774  call fatal_error&
2775  &('Improper formatting of Non-Julian Tidal Forcing File: ISCAN ERROR# '//trim(iserr),&
2776  & 'The header must contain: "OBC Node Number = "', &
2777  & 'Followed by and integer number of boundary nodes')
2778  END IF
2779 
2780  if(dbg_set(dbg_io)) write(ipt,*) "OBC NODE NUMBER =",myobc
2781 
2782  ALLOCATE(mptd(myobc,ntc))
2783  ALLOCATE(phs(myobc,ntc))
2784  ALLOCATE(rftmp(myobc,1))
2785  ALLOCATE(rf(myobc))
2786 
2787  IF(myobc == 0) RETURN
2788 
2789 
2790 
2791  ! READ THE AMPLITUDE
2792 
2793  if(dbg_set(dbg_io)) write(ipt,*) "READING AMPLITUDE DATA"
2794  rewind julobcunit_temp
2795 
2796  DO WHILE(.true.)
2797  READ(julobcunit_temp,*,iostat=ios) line
2798  if (ios /= 0) CALL fatal_error&
2799  &("Could not read Non Julian Tidal Forcing file. no keyword: 'Amplitude'")
2800 
2801  IF(line == line_amp) Exit
2802 
2803  END DO
2804 
2805  cnt = 0
2806  DO
2807  READ(julobcunit_temp,'(a)',iostat=ios) long_line
2808  IF(ios /=0) CALL fatal_error&
2809  &("While Reading Non Julian Tidal forcing Amplitude:",&
2810  & "Invalid line or end of file reached with out end of section!")
2811 
2812 
2813  IF(long_line == line_amp) THEN
2814 
2815  ! IF FINISHED READING SECTION => EXIT
2816  IF(cnt == myobc) EXIT
2817 
2818  ! OTHERWISE CALL AN ERROR
2819  CALL fatal_error&
2820  &("Unexpected end of section Amplitude in Non Julian Tidal forcing file",&
2821  & "Check the number of nodes in the list")
2822  END IF
2823 
2824  Call parse_tide(long_line,cnt,ntc,mptd,ios)
2825  ! IF THIS IS A COMMENT LINE OR BLANK
2826  IF(ios /=0) cycle
2827 
2828  ! ELSE CONTINUE TO NEXT
2829  END DO
2830 
2831 
2832  ! READ THE PHASE
2833  if(dbg_set(dbg_io)) write(ipt,*) "READING PHASE DATA"
2834  rewind julobcunit_temp
2835 
2836  DO WHILE(.true.)
2837  READ(julobcunit_temp,*,iostat=ios) line
2838  if (ios /= 0) CALL fatal_error&
2839  &("Could not read Non Julian Tidal Forcing file. no keyword: 'Phase'")
2840 
2841  IF(line == line_pha) Exit
2842 
2843  END DO
2844 
2845  cnt = 0
2846  DO WHILE(cnt <= myobc)
2847  READ(julobcunit_temp,'(a)',iostat=ios) long_line
2848  IF(ios /=0) CALL fatal_error&
2849  &("While Reading Non Julian Tidal forcing Phase:",&
2850  & "Invalid line or end of file reached with out end of section!")
2851 
2852 
2853  IF(long_line == line_pha) THEN
2854 
2855  ! IF FINISHED READING SECTION => EXIT
2856  IF(cnt == myobc) EXIT
2857 
2858  ! OTHERWISE CALL AN ERROR
2859  CALL fatal_error&
2860  &("Unexpected end of section Phase in Non Julian Tidal forcing file",&
2861  & "Check the number of nodes in the list")
2862  END IF
2863 
2864 
2865  Call parse_tide(long_line,cnt,ntc,phs,ios)
2866  ! IF THIS IS A COMMENT LINE OR BLANK
2867  IF(ios /=0) cycle
2868 
2869  END DO
2870 
2871  ! READ THE REFERENCE HEIGHT
2872 
2873  if(dbg_set(dbg_io)) write(ipt,*) "READING REFERENCE HEIGHT DATA"
2874  rewind julobcunit_temp
2875 
2876  DO WHILE(.true.)
2877  READ(julobcunit_temp,*,iostat=ios) line
2878  if (ios /= 0) CALL fatal_error&
2879  &("Could not read Non Julian Tidal Forcing file. no keyword: 'Eref'")
2880 
2881  IF(line == line_ref) Exit
2882 
2883  END DO
2884 
2885  cnt = 0
2886  DO WHILE(cnt <= myobc)
2887  READ(julobcunit_temp,'(a)',iostat=ios) long_line
2888  IF(ios /=0) CALL fatal_error&
2889  &("While Reading Non Julian Tidal forcing Eref:",&
2890  & "Invalid line or end of file reached with out end of section!")
2891 
2892  IF(long_line == line_ref) THEN
2893 
2894  ! IF FINISHED READING SECTION => EXIT
2895  IF(cnt == myobc) EXIT
2896 
2897  ! OTHERWISE CALL AN ERROR
2898  CALL fatal_error&
2899  &("Unexpected end of section Eref in Non Julian Tidal forcing file",&
2900  & "Check the number of nodes in the list")
2901  END IF
2902 
2903 
2904 
2905  Call parse_tide(long_line,cnt,1,rftmp,ios)
2906  ! IF THIS IS A COMMENT LINE OR BLANK
2907  IF(ios /=0) cycle
2908 
2909 
2910  END DO
2911 
2912  rf = rftmp(:,1)
2913  DEALLOCATE(rftmp)
2914 
2915 
2916  if(dbg_set(dbg_io)) WRITE(ipt,*) "! FINISHED READING NON-JULIAN TIDAL FORCING FILE"
2917 
character(len=80) date_format
Definition: mod_main.f90:125
subroutine print_real_time(mjd, IPT, char, TZONE)
Definition: mod_time.f90:1201
type(time) function read_datetime(timestr, frmt, TZONE, status)
Definition: mod_time.f90:640
character(len=80) timezone
Definition: mod_main.f90:126
logical use_real_world_time
Definition: mod_main.f90:131
subroutine parse_tide(line, cnt, ntc, data, ierr)
Definition: mod_input.f90:2922
integer ipt
Definition: mod_main.f90:922
integer ios
Definition: mod_obcs2.f90:81
subroutine print_time(mjd, IPT, char)
Definition: mod_time.f90:1166
Here is the call graph for this function:
Here is the caller graph for this function:

◆ search_for_last_matching_name()

subroutine mod_input::search_for_last_matching_name ( character(len=160), intent(inout)  FNAME)

Definition at line 1126 of file mod_input.f90.

1126  IMPLICIT NONE
1127  CHARACTER(LEN=160), INTENT(INOUT) :: FNAME
1128  CHARACTER(LEN=160) :: FNAME_NEXT
1129  logical :: fexist
1130 
1131  inquire(file=trim(fname),exist=fexist)
1132  IF(.not. fexist) CALL fatal_error &
1133  & ("Base name can not be found while searching for crashrestart file:",&
1134  & trim(fname), "If there is no output yet a crashrestart does&
1135  & not make much sense...", "there is something wrong with your model")
1136 
1137  DO
1138  fname_next = fname
1139  CALL incriment_fname(fname_next)
1140  ! ADD A MORE DEFINIATIVE CHECK THAN EXISTANCE OF FILE!
1141  inquire(file=trim(fname_next),exist=fexist)
1142 
1143  IF(.not. fexist) THEN
1144  if(dbg_set(dbg_log))&
1145  & write(ipt,*) "FOUND LAST FILE: "//trim(fname)
1146 
1147  RETURN
1148  ELSE
1149  fname = fname_next
1150  END IF
1151  END DO
1152 
subroutine incriment_fname(FNAME)
Definition: mod_input.f90:988
integer ipt
Definition: mod_main.f90:922
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ nc_avg

type(ncfile), pointer mod_input::nc_avg

Definition at line 49 of file mod_input.f90.

49  TYPE(NCFILE), POINTER ::NC_AVG

◆ nc_dat

type(ncfile), pointer mod_input::nc_dat

Definition at line 48 of file mod_input.f90.

48  TYPE(NCFILE), POINTER ::NC_DAT

◆ nc_rst

type(ncfile), pointer mod_input::nc_rst

Definition at line 50 of file mod_input.f90.

50  TYPE(NCFILE), POINTER ::NC_RST

◆ nc_start

type(ncfile), pointer mod_input::nc_start

Definition at line 51 of file mod_input.f90.

51  TYPE(NCFILE), POINTER ::NC_START