SICOPOLIS V5-dev  Revision 1264
read_ad_data.F90
Go to the documentation of this file.
1 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 !
3 ! Subroutine : r e a d _ a d _ d a t a
4 !
5 !> @file
6 !!
7 !! Reading in of whatever data is needed to calculate cost function in
8 !! adjoint mode.
9 !!
10 !! @section Copyright
11 !!
12 !! Copyright 2009-2018 Ralf Greve
13 !!
14 !! @section License
15 !!
16 !! This file is part of SICOPOLIS.
17 !!
18 !! SICOPOLIS is free software: you can redistribute it and/or modify
19 !! it under the terms of the GNU General Public License as published by
20 !! the Free Software Foundation, either version 3 of the License, or
21 !! (at your option) any later version.
22 !!
23 !! SICOPOLIS is distributed in the hope that it will be useful,
24 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
25 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 !! GNU General Public License for more details.
27 !!
28 !! You should have received a copy of the GNU General Public License
29 !! along with SICOPOLIS. If not, see <http://www.gnu.org/licenses/>.
30 !<
31 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
32 
33 !-------------------------------------------------------------------------------
34 !> Reading in of data.
35 !<------------------------------------------------------------------------------
36 subroutine read_ad_data()
37 
38 use sico_types_m
40 use sico_vars_m
41 
42 implicit none
43 
44 integer(i4b) :: ios, i, j, k, kc, kt
45 !real(dp), dimension(0:JMAX,0:IMAX) :: H_data
46 
47 ! If using ice thickness data as a target:
48 !open(unit=90, iostat=ios, file='ice_thick.dat', status='old')
49 !do j=0,JMAX
50 ! read(unit=90, fmt=*) (H_obs(j,i), i=0,IMAX)
51 !end do
52 !close(unit=90)
53 
54 ! Else if useing the gridded ages as a target:
55 ! [Note: this file starts with the KT ages first, then the KC]
56 open(unit=90, iostat=ios, file='gridded_age.dat', status='old')
57 do k=0,kcmax+ktmax+1
58  do j=0,jmax
59  read(unit=90, fmt=*) (age_data(k,j,i), i=0,imax)
60  end do
61 end do
62 close(unit=90)
63 
64 ! Now we have an option where we can initialize the ages
65 ! (for testing purposes only):
66 
67 do k=0,kcmax+ktmax+1
68  do j=0,jmax
69  do i=0,imax
70  if (k.le.ktmax) then
71  kt=k
72  age_t (kt,j,i) = age_data(k,j,i)*365*24*3600
73  age_t_neu(kt,j,i) = age_data(k,j,i)*365*24*3600
74  else
75  kc=k - (ktmax+1)
76  age_c (kc,j,i) = age_data(k,j,i)*365*24*3600
77  age_c_neu(kc,j,i) = age_data(k,j,i)*365*24*3600
78  end if
79  end do
80  end do
81 end do
82 
83 end subroutine read_ad_data
real(dp), dimension(0:ktmax, 0:jmax, 0:imax) age_t_neu
(.)_neu: New value of quantity (.) computed during an integration step
Declarations of global variables for SICOPOLIS (for the ANT domain).
Definition: sico_vars_m.F90:35
real(dp), dimension(0:kcmax, 0:jmax, 0:imax) age_c_neu
(.)_neu: New value of quantity (.) computed during an integration step
Declarations of kind types for SICOPOLIS.
subroutine read_ad_data()
Reading in of data.
Declarations of global variables for SICOPOLIS.