CTBTO FLEXPART WO4 (2015-10-15)
 All Classes Files Functions Variables
fpgridcheck.F90
Go to the documentation of this file.
1 
2 subroutine fpgridcheck
3 
4  use par_mod
5  use com_mod
6  use conv_mod
8  !use cmapf_mod, only: stlmbr,stcm2p
9 
10  implicit none
11 
12  INTEGER :: ifn ! .fp file index number
13  integer :: i
14  logical :: exists
15  character(len=512) fpfname ! .fp filename
16 
17 
18  ! Determine which .fp file to load for getting gribcheck variables
19  ! Note that this picks out the first or last file in the AVAIALBLE file,
20  ! not necessarily the first or last file of the simulation (in some cases
21  ! the simulation may not use all the files in the AVAILABLE file
22  !if(ideltas.gt.0) then
23  ! ifn=1
24  !else
25  ! ifn=numbwf
26  !endif
27  ifn=0
28  do i=1,numbwf
29  if ( ifn.eq.0 ) then
30  if ( ldirect.eq.1 ) then
31  inquire(file=trim(path(3)) // trim(wfname(i)) // '_fwd.fp', exist=exists)
32  else
33  inquire(file=trim(path(3)) // trim(wfname(i)) // '_bwd.fp', exist=exists)
34  endif
35  if ( exists ) then
36  ifn = i
37  endif
38  endif
39  end do
40 
41  ! Create the file name and load her up
42  if ( ldirect.eq.1 ) then
43  fpfname = trim(path(3)) // trim(wfname(ifn)) // '_fwd.fp'
44  else
45  fpfname = trim(path(3)) // trim(wfname(ifn)) // '_bwd.fp'
46  endif
47  print *, 'fpgridcheck(): LOADING.... ', trim(fpfname)
48 
49  ! The second argument of this call indicates which index (1 or 2)
50  ! the met fields will be loaded into. For this call, we don't really
51  ! care. We just want the stuff relevant to gridcheck. So, we arbitrarily
52  ! load the other stuff in index 1. It will be overwritten in subsequent
53  ! loads.
54  CALL fpmetbinary_load(trim(fpfname), 1)
55 
56 
57 end subroutine fpgridcheck
subroutine fpmetbinary_load(filename, cm_index)
subroutine fpgridcheck
Definition: fpgridcheck.F90:2