[3614] | 1 | MODULE icbtrj |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE icbtrj *** |
---|
| 4 | !! Ocean physics: trajectory I/O routines |
---|
| 5 | !!====================================================================== |
---|
[9190] | 6 | !! History : 3.3 ! 2010-01 (Martin&Adcroft) Original code |
---|
| 7 | !! - ! 2011-03 (Madec) Part conversion to NEMO form |
---|
| 8 | !! - ! Removal of mapping from another grid |
---|
| 9 | !! - ! 2011-05 (Alderson) New module to handle trajectory output |
---|
[3614] | 10 | !!---------------------------------------------------------------------- |
---|
[9190] | 11 | |
---|
[3614] | 12 | !!---------------------------------------------------------------------- |
---|
[9226] | 13 | !! icb_trj_init : initialise iceberg trajectory output files |
---|
[9190] | 14 | !! icb_trj_write : |
---|
| 15 | !! icb_trj_sync : |
---|
| 16 | !! icb_trj_end : |
---|
[3614] | 17 | !!---------------------------------------------------------------------- |
---|
| 18 | USE par_oce ! NEMO parameters |
---|
| 19 | USE dom_oce ! NEMO ocean domain |
---|
| 20 | USE phycst ! NEMO physical constants |
---|
[9019] | 21 | USE icb_oce ! define iceberg arrays |
---|
| 22 | USE icbutl ! iceberg utility routines |
---|
| 23 | ! |
---|
[3614] | 24 | USE lib_mpp ! NEMO MPI library, lk_mpp in particular |
---|
| 25 | USE in_out_manager ! NEMO IO, numout in particular |
---|
[9019] | 26 | USE ioipsl , ONLY : ju2ymds ! for calendar |
---|
[3614] | 27 | USE netcdf |
---|
| 28 | |
---|
| 29 | IMPLICIT NONE |
---|
| 30 | PRIVATE |
---|
| 31 | |
---|
| 32 | PUBLIC icb_trj_init ! routine called in icbini.F90 module |
---|
| 33 | PUBLIC icb_trj_write ! routine called in icbstp.F90 module |
---|
| 34 | PUBLIC icb_trj_sync ! routine called in icbstp.F90 module |
---|
| 35 | PUBLIC icb_trj_end ! routine called in icbstp.F90 module |
---|
| 36 | |
---|
[14037] | 37 | INTEGER :: num_traj = 0 |
---|
[3614] | 38 | INTEGER :: n_dim, m_dim |
---|
| 39 | INTEGER :: ntrajid |
---|
| 40 | INTEGER :: numberid, nstepid, nscaling_id |
---|
| 41 | INTEGER :: nlonid, nlatid, nxid, nyid, nuvelid, nvvelid, nmassid |
---|
[14044] | 42 | INTEGER :: nssuid, nssvid, nuaid, nvaid, nuiid, nviid |
---|
[3614] | 43 | INTEGER :: nsshxid, nsshyid, nsstid, ncntid, nthkid |
---|
| 44 | INTEGER :: nthicknessid, nwidthid, nlengthid |
---|
| 45 | INTEGER :: nyearid, ndayid |
---|
| 46 | INTEGER :: nmass_of_bits_id, nheat_density_id |
---|
| 47 | |
---|
| 48 | !!---------------------------------------------------------------------- |
---|
[9598] | 49 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[5215] | 50 | !! $Id$ |
---|
[10068] | 51 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[3614] | 52 | !!---------------------------------------------------------------------- |
---|
| 53 | CONTAINS |
---|
| 54 | |
---|
| 55 | SUBROUTINE icb_trj_init( ktend ) |
---|
| 56 | !!---------------------------------------------------------------------- |
---|
| 57 | !! *** ROUTINE icb_trj_init *** |
---|
| 58 | !! |
---|
| 59 | !! ** Purpose : initialise iceberg trajectory output files |
---|
| 60 | !!---------------------------------------------------------------------- |
---|
[9019] | 61 | INTEGER, INTENT(in) :: ktend ! time step index |
---|
[3614] | 62 | ! |
---|
[9019] | 63 | INTEGER :: iret, iyear, imonth, iday |
---|
[12933] | 64 | INTEGER :: idg ! number of digits |
---|
[9019] | 65 | REAL(wp) :: zfjulday, zsec |
---|
| 66 | CHARACTER(len=80) :: cl_filename |
---|
[12933] | 67 | CHARACTER(LEN=12) :: clfmt ! writing format |
---|
[13062] | 68 | CHARACTER(LEN=8 ) :: cldate_ini, cldate_end |
---|
[9019] | 69 | TYPE(iceberg), POINTER :: this |
---|
| 70 | TYPE(point) , POINTER :: pt |
---|
[3614] | 71 | !!---------------------------------------------------------------------- |
---|
| 72 | |
---|
[8080] | 73 | ! compute initial time step date |
---|
| 74 | CALL ju2ymds( fjulday, iyear, imonth, iday, zsec ) |
---|
| 75 | WRITE(cldate_ini, '(i4.4,2i2.2)') iyear, imonth, iday |
---|
| 76 | |
---|
| 77 | ! compute end time step date |
---|
[12489] | 78 | zfjulday = fjulday + rn_Dt / rday * REAL( nitend - nit000 + 1 , wp) |
---|
[8080] | 79 | IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday ) zfjulday = REAL(NINT(zfjulday),wp) ! avoid truncation error |
---|
| 80 | CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec ) |
---|
| 81 | WRITE(cldate_end, '(i4.4,2i2.2)') iyear, imonth, iday |
---|
| 82 | |
---|
| 83 | ! define trajectory output name |
---|
[13062] | 84 | cl_filename = 'trajectory_icebergs_'//cldate_ini//'-'//cldate_end |
---|
[12933] | 85 | IF ( lk_mpp ) THEN |
---|
[13009] | 86 | idg = MAX( INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1, 4 ) ! how many digits to we need to write? min=4, max=9 |
---|
| 87 | WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg ! '(a,a,ix.x,a)' |
---|
[13062] | 88 | WRITE(cl_filename, clfmt) TRIM(cl_filename), '_', narea-1, '.nc' |
---|
[12933] | 89 | ELSE |
---|
[13062] | 90 | WRITE(cl_filename,'(a,a)') TRIM(cl_filename), '.nc' |
---|
[3614] | 91 | ENDIF |
---|
[9226] | 92 | IF( lwp .AND. nn_verbose_level >= 0 ) WRITE(numout,'(2a)') 'icebergs, icb_trj_init: creating ',TRIM(cl_filename) |
---|
[3614] | 93 | |
---|
[9226] | 94 | iret = NF90_CREATE( TRIM(cl_filename), NF90_CLOBBER, ntrajid ) |
---|
| 95 | IF (iret .NE. NF90_NOERR) CALL ctl_stop('icebergs, icb_trj_init: nf_create failed') |
---|
[3614] | 96 | |
---|
| 97 | ! Dimensions |
---|
[9226] | 98 | iret = NF90_DEF_DIM( ntrajid, 'n', NF90_UNLIMITED, n_dim ) |
---|
| 99 | IF ( iret /= NF90_NOERR ) CALL ctl_stop('icebergs, icb_trj_init: nf_def_dim n failed') |
---|
| 100 | iret = NF90_DEF_DIM( ntrajid, 'k', nkounts, m_dim ) |
---|
| 101 | IF ( iret /= NF90_NOERR ) CALL ctl_stop('icebergs, icb_trj_init: nf_def_dim k failed') |
---|
[3614] | 102 | |
---|
| 103 | ! Variables |
---|
[9226] | 104 | iret = NF90_DEF_VAR( ntrajid, 'iceberg_number', NF90_INT , (/m_dim,n_dim/), numberid ) |
---|
| 105 | iret = NF90_DEF_VAR( ntrajid, 'timestep' , NF90_INT , n_dim , nstepid ) |
---|
| 106 | iret = NF90_DEF_VAR( ntrajid, 'mass_scaling' , NF90_DOUBLE, n_dim , nscaling_id ) |
---|
| 107 | iret = NF90_DEF_VAR( ntrajid, 'lon' , NF90_DOUBLE, n_dim , nlonid ) |
---|
| 108 | iret = NF90_DEF_VAR( ntrajid, 'lat' , NF90_DOUBLE, n_dim , nlatid ) |
---|
| 109 | iret = NF90_DEF_VAR( ntrajid, 'xi' , NF90_DOUBLE, n_dim , nxid ) |
---|
| 110 | iret = NF90_DEF_VAR( ntrajid, 'yj' , NF90_DOUBLE, n_dim , nyid ) |
---|
| 111 | iret = NF90_DEF_VAR( ntrajid, 'uvel' , NF90_DOUBLE, n_dim , nuvelid ) |
---|
| 112 | iret = NF90_DEF_VAR( ntrajid, 'vvel' , NF90_DOUBLE, n_dim , nvvelid ) |
---|
[14044] | 113 | iret = NF90_DEF_VAR( ntrajid, 'ssu' , NF90_DOUBLE, n_dim , nssuid ) |
---|
| 114 | iret = NF90_DEF_VAR( ntrajid, 'ssv' , NF90_DOUBLE, n_dim , nssvid ) |
---|
[9226] | 115 | iret = NF90_DEF_VAR( ntrajid, 'uta' , NF90_DOUBLE, n_dim , nuaid ) |
---|
| 116 | iret = NF90_DEF_VAR( ntrajid, 'vta' , NF90_DOUBLE, n_dim , nvaid ) |
---|
| 117 | iret = NF90_DEF_VAR( ntrajid, 'uti' , NF90_DOUBLE, n_dim , nuiid ) |
---|
| 118 | iret = NF90_DEF_VAR( ntrajid, 'vti' , NF90_DOUBLE, n_dim , nviid ) |
---|
| 119 | iret = NF90_DEF_VAR( ntrajid, 'ssh_x' , NF90_DOUBLE, n_dim , nsshxid ) |
---|
| 120 | iret = NF90_DEF_VAR( ntrajid, 'ssh_y' , NF90_DOUBLE, n_dim , nsshyid ) |
---|
| 121 | iret = NF90_DEF_VAR( ntrajid, 'sst' , NF90_DOUBLE, n_dim , nsstid ) |
---|
| 122 | iret = NF90_DEF_VAR( ntrajid, 'icnt' , NF90_DOUBLE, n_dim , ncntid ) |
---|
| 123 | iret = NF90_DEF_VAR( ntrajid, 'ithk' , NF90_DOUBLE, n_dim , nthkid ) |
---|
| 124 | iret = NF90_DEF_VAR( ntrajid, 'mass' , NF90_DOUBLE, n_dim , nmassid ) |
---|
| 125 | iret = NF90_DEF_VAR( ntrajid, 'thickness' , NF90_DOUBLE, n_dim , nthicknessid ) |
---|
| 126 | iret = NF90_DEF_VAR( ntrajid, 'width' , NF90_DOUBLE, n_dim , nwidthid ) |
---|
| 127 | iret = NF90_DEF_VAR( ntrajid, 'length' , NF90_DOUBLE, n_dim , nlengthid ) |
---|
| 128 | iret = NF90_DEF_VAR( ntrajid, 'year' , NF90_INT , n_dim , nyearid ) |
---|
| 129 | iret = NF90_DEF_VAR( ntrajid, 'day' , NF90_DOUBLE, n_dim , ndayid ) |
---|
| 130 | iret = NF90_DEF_VAR( ntrajid, 'mass_of_bits' , NF90_DOUBLE, n_dim , nmass_of_bits_id ) |
---|
| 131 | iret = NF90_DEF_VAR( ntrajid, 'heat_density' , NF90_DOUBLE, n_dim , nheat_density_id ) |
---|
[3614] | 132 | |
---|
| 133 | ! Attributes |
---|
[9226] | 134 | iret = NF90_PUT_ATT( ntrajid, numberid , 'long_name', 'iceberg number on this processor' ) |
---|
| 135 | iret = NF90_PUT_ATT( ntrajid, numberid , 'units' , 'count' ) |
---|
| 136 | iret = NF90_PUT_ATT( ntrajid, nstepid , 'long_name', 'timestep number kt' ) |
---|
| 137 | iret = NF90_PUT_ATT( ntrajid, nstepid , 'units' , 'count' ) |
---|
| 138 | iret = NF90_PUT_ATT( ntrajid, nlonid , 'long_name', 'longitude' ) |
---|
| 139 | iret = NF90_PUT_ATT( ntrajid, nlonid , 'units' , 'degrees_E') |
---|
| 140 | iret = NF90_PUT_ATT( ntrajid, nlatid , 'long_name', 'latitude' ) |
---|
| 141 | iret = NF90_PUT_ATT( ntrajid, nlatid , 'units' , 'degrees_N' ) |
---|
| 142 | iret = NF90_PUT_ATT( ntrajid, nxid , 'long_name', 'x grid box position' ) |
---|
| 143 | iret = NF90_PUT_ATT( ntrajid, nxid , 'units' , 'fractional' ) |
---|
| 144 | iret = NF90_PUT_ATT( ntrajid, nyid , 'long_name', 'y grid box position' ) |
---|
| 145 | iret = NF90_PUT_ATT( ntrajid, nyid , 'units' , 'fractional' ) |
---|
| 146 | iret = NF90_PUT_ATT( ntrajid, nuvelid , 'long_name', 'zonal velocity' ) |
---|
| 147 | iret = NF90_PUT_ATT( ntrajid, nuvelid , 'units' , 'm/s' ) |
---|
| 148 | iret = NF90_PUT_ATT( ntrajid, nvvelid , 'long_name', 'meridional velocity' ) |
---|
| 149 | iret = NF90_PUT_ATT( ntrajid, nvvelid , 'units' , 'm/s' ) |
---|
[14044] | 150 | iret = NF90_PUT_ATT( ntrajid, nssuid , 'long_name', 'ocean u component' ) |
---|
| 151 | iret = NF90_PUT_ATT( ntrajid, nssuid , 'units' , 'm/s' ) |
---|
| 152 | iret = NF90_PUT_ATT( ntrajid, nssvid , 'long_name', 'ocean v component' ) |
---|
| 153 | iret = NF90_PUT_ATT( ntrajid, nssvid , 'units' , 'm/s' ) |
---|
[9226] | 154 | iret = NF90_PUT_ATT( ntrajid, nuaid , 'long_name', 'atmosphere u component' ) |
---|
| 155 | iret = NF90_PUT_ATT( ntrajid, nuaid , 'units' , 'm/s' ) |
---|
| 156 | iret = NF90_PUT_ATT( ntrajid, nvaid , 'long_name', 'atmosphere v component' ) |
---|
| 157 | iret = NF90_PUT_ATT( ntrajid, nvaid , 'units' , 'm/s' ) |
---|
| 158 | iret = NF90_PUT_ATT( ntrajid, nuiid , 'long_name', 'sea ice u component' ) |
---|
| 159 | iret = NF90_PUT_ATT( ntrajid, nuiid , 'units' , 'm/s' ) |
---|
| 160 | iret = NF90_PUT_ATT( ntrajid, nviid , 'long_name', 'sea ice v component' ) |
---|
| 161 | iret = NF90_PUT_ATT( ntrajid, nviid , 'units' , 'm/s' ) |
---|
| 162 | iret = NF90_PUT_ATT( ntrajid, nsshxid , 'long_name', 'sea surface height gradient from x points' ) |
---|
| 163 | iret = NF90_PUT_ATT( ntrajid, nsshxid , 'units' , 'm/m' ) |
---|
| 164 | iret = NF90_PUT_ATT( ntrajid, nsshyid , 'long_name', 'sea surface height gradient from y points' ) |
---|
| 165 | iret = NF90_PUT_ATT( ntrajid, nsshyid , 'units' , 'm/m' ) |
---|
| 166 | iret = NF90_PUT_ATT( ntrajid, nsstid , 'long_name', 'sea surface temperature' ) |
---|
| 167 | iret = NF90_PUT_ATT( ntrajid, nsstid , 'units' , 'degC') |
---|
| 168 | iret = NF90_PUT_ATT( ntrajid, ncntid , 'long_name', 'sea ice concentration' ) |
---|
| 169 | iret = NF90_PUT_ATT( ntrajid, ncntid , 'units' , 'degC') |
---|
| 170 | iret = NF90_PUT_ATT( ntrajid, nthkid , 'long_name', 'sea ice thickness' ) |
---|
| 171 | iret = NF90_PUT_ATT( ntrajid, nthkid , 'units' , 'm' ) |
---|
| 172 | iret = NF90_PUT_ATT( ntrajid, nmassid , 'long_name', 'mass') |
---|
| 173 | iret = NF90_PUT_ATT( ntrajid, nmassid , 'units' , 'kg' ) |
---|
| 174 | iret = NF90_PUT_ATT( ntrajid, nthicknessid , 'long_name', 'thickness' ) |
---|
| 175 | iret = NF90_PUT_ATT( ntrajid, nthicknessid , 'units' , 'm' ) |
---|
| 176 | iret = NF90_PUT_ATT( ntrajid, nwidthid , 'long_name', 'width' ) |
---|
| 177 | iret = NF90_PUT_ATT( ntrajid, nwidthid , 'units' , 'm' ) |
---|
| 178 | iret = NF90_PUT_ATT( ntrajid, nlengthid , 'long_name', 'length' ) |
---|
| 179 | iret = NF90_PUT_ATT( ntrajid, nlengthid , 'units' , 'm' ) |
---|
| 180 | iret = NF90_PUT_ATT( ntrajid, nyearid , 'long_name', 'calendar year' ) |
---|
| 181 | iret = NF90_PUT_ATT( ntrajid, nyearid , 'units' , 'years' ) |
---|
| 182 | iret = NF90_PUT_ATT( ntrajid, ndayid , 'long_name', 'day of year' ) |
---|
| 183 | iret = NF90_PUT_ATT( ntrajid, ndayid , 'units' , 'days' ) |
---|
| 184 | iret = NF90_PUT_ATT( ntrajid, nscaling_id , 'long_name', 'scaling factor for mass of berg' ) |
---|
| 185 | iret = NF90_PUT_ATT( ntrajid, nscaling_id , 'units' , 'none' ) |
---|
| 186 | iret = NF90_PUT_ATT( ntrajid, nmass_of_bits_id, 'long_name', 'mass of bergy bits' ) |
---|
| 187 | iret = NF90_PUT_ATT( ntrajid, nmass_of_bits_id, 'units' , 'kg' ) |
---|
| 188 | iret = NF90_PUT_ATT( ntrajid, nheat_density_id, 'long_name', 'heat density' ) |
---|
| 189 | iret = NF90_PUT_ATT( ntrajid, nheat_density_id, 'units' , 'J/kg' ) |
---|
| 190 | ! |
---|
[3614] | 191 | ! End define mode |
---|
[9226] | 192 | iret = NF90_ENDDEF( ntrajid ) |
---|
[3614] | 193 | ! |
---|
| 194 | END SUBROUTINE icb_trj_init |
---|
| 195 | |
---|
| 196 | |
---|
| 197 | SUBROUTINE icb_trj_write( kt ) |
---|
| 198 | !!---------------------------------------------------------------------- |
---|
| 199 | !! *** ROUTINE icb_trj_write *** |
---|
| 200 | !! |
---|
| 201 | !! ** Purpose : write out iceberg trajectories |
---|
| 202 | !! |
---|
| 203 | !! ** Method : - for the moment write out each snapshot of positions later |
---|
| 204 | !! can rewrite so that it is buffered and written out more efficiently |
---|
| 205 | !!---------------------------------------------------------------------- |
---|
[9226] | 206 | INTEGER, INTENT( in ) :: kt ! time-step index |
---|
[3614] | 207 | ! |
---|
| 208 | INTEGER :: iret, jn |
---|
| 209 | CHARACTER(len=80) :: cl_filename |
---|
| 210 | TYPE(iceberg), POINTER :: this |
---|
[9226] | 211 | TYPE(point ), POINTER :: pt |
---|
[3614] | 212 | !!---------------------------------------------------------------------- |
---|
| 213 | |
---|
| 214 | ! Write variables |
---|
| 215 | ! sga - just write out the current point of the trajectory |
---|
| 216 | |
---|
| 217 | this => first_berg |
---|
| 218 | jn = num_traj |
---|
[9226] | 219 | DO WHILE( ASSOCIATED(this) ) |
---|
[3614] | 220 | pt => this%current_point |
---|
[9226] | 221 | jn = jn + 1 |
---|
| 222 | ! |
---|
| 223 | iret = NF90_PUT_VAR( ntrajid, numberid , this%number , (/1,jn/) , (/nkounts,1/) ) |
---|
| 224 | iret = NF90_PUT_VAR( ntrajid, nstepid , kt , (/ jn /) ) |
---|
| 225 | iret = NF90_PUT_VAR( ntrajid, nscaling_id , this%mass_scaling, (/ jn /) ) |
---|
| 226 | ! |
---|
| 227 | iret = NF90_PUT_VAR( ntrajid, nlonid , pt%lon , (/ jn /) ) |
---|
| 228 | iret = NF90_PUT_VAR( ntrajid, nlatid , pt%lat , (/ jn /) ) |
---|
| 229 | iret = NF90_PUT_VAR( ntrajid, nxid , pt%xi , (/ jn /) ) |
---|
| 230 | iret = NF90_PUT_VAR( ntrajid, nyid , pt%yj , (/ jn /) ) |
---|
| 231 | iret = NF90_PUT_VAR( ntrajid, nuvelid , pt%uvel , (/ jn /) ) |
---|
| 232 | iret = NF90_PUT_VAR( ntrajid, nvvelid , pt%vvel , (/ jn /) ) |
---|
[14044] | 233 | iret = NF90_PUT_VAR( ntrajid, nssuid , pt%ssu , (/ jn /) ) |
---|
| 234 | iret = NF90_PUT_VAR( ntrajid, nssvid , pt%ssv , (/ jn /) ) |
---|
[9226] | 235 | iret = NF90_PUT_VAR( ntrajid, nuaid , pt%ua , (/ jn /) ) |
---|
| 236 | iret = NF90_PUT_VAR( ntrajid, nvaid , pt%va , (/ jn /) ) |
---|
| 237 | iret = NF90_PUT_VAR( ntrajid, nuiid , pt%ui , (/ jn /) ) |
---|
| 238 | iret = NF90_PUT_VAR( ntrajid, nviid , pt%vi , (/ jn /) ) |
---|
| 239 | iret = NF90_PUT_VAR( ntrajid, nsshxid , pt%ssh_x , (/ jn /) ) |
---|
| 240 | iret = NF90_PUT_VAR( ntrajid, nsshyid , pt%ssh_y , (/ jn /) ) |
---|
| 241 | iret = NF90_PUT_VAR( ntrajid, nsstid , pt%sst , (/ jn /) ) |
---|
| 242 | iret = NF90_PUT_VAR( ntrajid, ncntid , pt%cn , (/ jn /) ) |
---|
| 243 | iret = NF90_PUT_VAR( ntrajid, nthkid , pt%hi , (/ jn /) ) |
---|
| 244 | iret = NF90_PUT_VAR( ntrajid, nmassid , pt%mass , (/ jn /) ) |
---|
| 245 | iret = NF90_PUT_VAR( ntrajid, nthicknessid , pt%thickness , (/ jn /) ) |
---|
| 246 | iret = NF90_PUT_VAR( ntrajid, nwidthid , pt%width , (/ jn /) ) |
---|
| 247 | iret = NF90_PUT_VAR( ntrajid, nlengthid , pt%length , (/ jn /) ) |
---|
| 248 | iret = NF90_PUT_VAR( ntrajid, nyearid , pt%year , (/ jn /) ) |
---|
| 249 | iret = NF90_PUT_VAR( ntrajid, ndayid , pt%day , (/ jn /) ) |
---|
| 250 | iret = NF90_PUT_VAR( ntrajid, nmass_of_bits_id, pt%mass_of_bits , (/ jn /) ) |
---|
| 251 | iret = NF90_PUT_VAR( ntrajid, nheat_density_id, pt%heat_density , (/ jn /) ) |
---|
| 252 | ! |
---|
| 253 | this => this%next |
---|
[3614] | 254 | END DO |
---|
[9226] | 255 | IF( lwp .AND. nn_verbose_level > 0 ) WRITE(numout,*) 'trajectory write to frame ', jn |
---|
[3614] | 256 | num_traj = jn |
---|
| 257 | ! |
---|
| 258 | END SUBROUTINE icb_trj_write |
---|
| 259 | |
---|
| 260 | |
---|
| 261 | SUBROUTINE icb_trj_sync() |
---|
| 262 | !!---------------------------------------------------------------------- |
---|
| 263 | !! *** ROUTINE icb_trj_sync *** |
---|
| 264 | !! |
---|
| 265 | !! ** Purpose : |
---|
| 266 | !!---------------------------------------------------------------------- |
---|
[9190] | 267 | INTEGER :: iret |
---|
[3614] | 268 | !!---------------------------------------------------------------------- |
---|
| 269 | ! flush to file |
---|
[9226] | 270 | iret = NF90_SYNC( ntrajid ) |
---|
| 271 | IF ( iret /= NF90_NOERR ) CALL ctl_stop( 'icebergs, icb_trj_sync: nf_sync failed' ) |
---|
[3614] | 272 | ! |
---|
| 273 | END SUBROUTINE icb_trj_sync |
---|
| 274 | |
---|
| 275 | |
---|
| 276 | SUBROUTINE icb_trj_end() |
---|
| 277 | !!---------------------------------------------------------------------- |
---|
[9190] | 278 | INTEGER :: iret |
---|
| 279 | !!---------------------------------------------------------------------- |
---|
[3614] | 280 | ! Finish up |
---|
[9226] | 281 | iret = NF90_CLOSE( ntrajid ) |
---|
| 282 | IF ( iret /= NF90_NOERR ) CALL ctl_stop( 'icebergs, icb_trj_end: nf_close failed' ) |
---|
[3614] | 283 | ! |
---|
| 284 | END SUBROUTINE icb_trj_end |
---|
| 285 | |
---|
[9190] | 286 | !!====================================================================== |
---|
[3614] | 287 | END MODULE icbtrj |
---|