forked from NOAA-EMC/CMEPS
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathesmFldsExchange_coastal_mod.F90
591 lines (510 loc) · 23.8 KB
/
esmFldsExchange_coastal_mod.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
module esmFldsExchange_coastal_mod
use ESMF
use NUOPC
use med_utils_mod , only : chkerr => med_utils_chkerr
use med_kind_mod , only : CX=>SHR_KIND_CX
use med_kind_mod , only : CS=>SHR_KIND_CS
use med_kind_mod , only : CL=>SHR_KIND_CL
use med_kind_mod , only : R8=>SHR_KIND_R8
use med_internalstate_mod , only : compmed
use med_internalstate_mod , only : compatm
use med_internalstate_mod , only : compocn
use med_internalstate_mod , only : compwav
use med_internalstate_mod , only : ncomps
use med_internalstate_mod , only : coupling_mode
!---------------------------------------------------------------------
! This is a mediator specific routine that determines ALL possible
! fields exchanged between components and their associated routing,
! mapping and merging
!---------------------------------------------------------------------
implicit none
public
public :: esmFldsExchange_coastal
character(*), parameter :: u_FILE_u = &
__FILE__
type gcomp_attr
character(len=CX) :: atm2ocn_fmap = 'unset'
character(len=CX) :: atm2ocn_smap = 'unset'
character(len=CX) :: atm2ocn_vmap = 'unset'
character(len=CX) :: atm2wav_smap = 'unset'
character(len=CX) :: ocn2atm_fmap = 'unset'
character(len=CX) :: ocn2atm_smap = 'unset'
character(len=CX) :: ocn2wav_smap = 'unset'
character(len=CX) :: wav2ocn_smap = 'unset'
character(len=CX) :: wav2atm_smap = 'unset'
character(len=CS) :: mapnorm = 'one'
logical :: atm_present = .false.
logical :: ocn_present = .false.
logical :: wav_present = .false.
end type
!===============================================================================
contains
!===============================================================================
subroutine esmFldsExchange_coastal(gcomp, phase, rc)
! input/output parameters:
type(ESMF_GridComp) :: gcomp
character(len=*) , intent(in) :: phase
integer , intent(inout) :: rc
! local variables:
character(len=*) , parameter :: subname='(esmFldsExchange_coastal)'
!--------------------------------------
call ESMF_LogWrite(trim(subname)//": called", ESMF_LOGMSG_INFO)
rc = ESMF_SUCCESS
if (phase == 'advertise') then
call esmFldsExchange_coastal_advt(gcomp, phase, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
elseif (phase == 'fieldcheck') then
call esmFldsExchange_coastal_fchk(gcomp, phase, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
elseif (phase == 'initialize') then
call esmFldsExchange_coastal_init(gcomp, phase, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
else
call ESMF_LogSetError(ESMF_FAILURE, &
msg=trim(subname)//": Phase is set to "//trim(phase), &
line=__LINE__, file=__FILE__, rcToReturn=rc)
return ! bail out
endif
call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO)
end subroutine esmFldsExchange_coastal
!-----------------------------------------------------------------------------
subroutine esmFldsExchange_coastal_advt(gcomp, phase, rc)
use esmFlds, only : addfld_to => med_fldList_addfld_to
use esmFlds, only : addfld_from => med_fldList_addfld_from
! input/output parameters:
type(ESMF_GridComp) :: gcomp
character(len=*) , intent(in) :: phase
integer , intent(inout) :: rc
! local variables:
integer :: n
logical :: isPresent
character(len=CL) :: cvalue
character(len=CS) :: fldname
character(len=CS) :: fldname1, fldname2
type(gcomp_attr) :: coastal_attr
character(len=CS), allocatable :: S_flds(:)
character(len=CS), allocatable :: F_flds(:,:)
character(len=*) , parameter :: subname='(esmFldsExchange_coastal_advt)'
!--------------------------------------
call ESMF_LogWrite(trim(subname)//": called", ESMF_LOGMSG_INFO)
rc = ESMF_SUCCESS
!=====================================================================
! scalar information
!=====================================================================
call NUOPC_CompAttributeGet(gcomp, name='ScalarFieldName', &
isPresent=isPresent, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (isPresent) then
call NUOPC_CompAttributeGet(gcomp, name="ScalarFieldName", &
value=cvalue, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
do n = 1,ncomps
call addfld_from(n, trim(cvalue))
call addfld_to(n, trim(cvalue))
end do
end if
!=====================================================================
! attribute settings
!=====================================================================
call esmFldsExchange_coastal_attr(gcomp, coastal_attr, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
!=====================================================================
! FIELDS TO MEDIATOR component (for fractions and atm/ocn flux calculation)
!=====================================================================
!----------------------------------------------------------
! to med: masks from components
!----------------------------------------------------------
call addfld_from(compocn, 'So_omask')
!----------------------------------------------------------
! to med: frac from components
!----------------------------------------------------------
call addfld_to(compatm, 'So_ofrac')
!=====================================================================
! FIELDS TO OCEAN (compocn)
!=====================================================================
! ---------------------------------------------------------------------
! to ocn: state fields
! ---------------------------------------------------------------------
if (coastal_attr%atm_present .and. coastal_attr%ocn_present) then
allocate(S_flds(8))
S_flds = (/'Sa_u10m ', & ! inst_zonal_wind_height10m
'Sa_v10m ', & ! inst_merid_wind_height10m
'Sa_pslv ', & ! inst_pres_height_surface!
'Sa_t2m ', & ! inst_temp_height2m
'Sa_q2m ', & ! inst_spec_humid_height2m
'Faxa_lwdn ', & ! mean_down_lw_flx
'Faxa_swnet', & ! mean_net_sw_flx
'Faxa_rain ' /) ! mean_prec_rate
do n = 1,size(S_flds)
fldname = trim(S_flds(n))
call addfld_from(compatm, trim(fldname))
call addfld_to(compocn, trim(fldname))
end do
deallocate(S_flds)
end if
! ---------------------------------------------------------------------
! to ocn: wave fields
! ---------------------------------------------------------------------
if (coastal_attr%wav_present .and. coastal_attr%ocn_present) then
allocate(S_flds(3))
S_flds = (/'Sw_wavsuu', & ! eastward_wave_radiation_stress
'Sw_wavsuv', & ! eastward_northward_wave_radiation_stress
'Sw_wavsvv' /) ! northward_wave_radiation_stress
do n = 1,size(S_flds)
fldname = trim(S_flds(n))
call addfld_from(compwav, trim(fldname))
call addfld_to(compocn, trim(fldname))
end do
deallocate(S_flds)
end if
!=====================================================================
! FIELDS TO WAVE (compwav)
!=====================================================================
! ---------------------------------------------------------------------
! to wav: state fields
! ---------------------------------------------------------------------
if (coastal_attr%atm_present .and. coastal_attr%wav_present) then
allocate(S_flds(2))
S_flds = (/'Sa_u10m', & ! inst_zonal_wind_height10m
'Sa_v10m' /) ! inst_merid_wind_height10m
do n = 1,size(S_flds)
fldname = trim(S_flds(n))
call addfld_from(compatm, trim(fldname))
call addfld_to(compwav, trim(fldname))
end do
deallocate(S_flds)
end if
! ---------------------------------------------------------------------
! to wav: ocean fields
! ---------------------------------------------------------------------
if (coastal_attr%ocn_present .and. coastal_attr%wav_present) then
allocate(S_flds(2))
S_flds = (/'So_u', & ! ocn_current_zonal
'So_v' /) ! ocn_current_merid
do n = 1,size(S_flds)
fldname = trim(S_flds(n))
call addfld_from(compocn, trim(fldname))
call addfld_to(compwav, trim(fldname))
end do
deallocate(S_flds)
end if
call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO)
end subroutine esmFldsExchange_coastal_advt
!-----------------------------------------------------------------------------
subroutine esmFldsExchange_coastal_fchk(gcomp, phase, rc)
use med_methods_mod , only : fldchk => med_methods_FB_FldChk
use med_internalstate_mod , only : InternalState
! input/output parameters:
type(ESMF_GridComp) :: gcomp
character(len=*) , intent(in) :: phase
integer , intent(inout) :: rc
! local variables:
type(InternalState) :: is_local
character(len=*) , parameter :: subname='(esmFldsExchange_coastal_fchk)'
!--------------------------------------
call ESMF_LogWrite(trim(subname)//": called", ESMF_LOGMSG_INFO)
rc = ESMF_SUCCESS
!---------------------------------------
! Get the internal state
!---------------------------------------
nullify(is_local%wrap)
call ESMF_GridCompGetInternalState(gcomp, is_local, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (fldchk(is_local%wrap%FBImp(compocn,compocn),'So_omask',rc=rc)) then
call ESMF_LogWrite(trim(subname)//": Field connected "//"So_omask", &
ESMF_LOGMSG_INFO)
else
call ESMF_LogSetError(ESMF_FAILURE, &
msg=trim(subname)//": Field is not connected "//"So_omask", &
line=__LINE__, file=__FILE__, rcToReturn=rc)
return ! bail out
endif
call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO)
end subroutine esmFldsExchange_coastal_fchk
!-----------------------------------------------------------------------------
subroutine esmFldsExchange_coastal_init(gcomp, phase, rc)
use med_methods_mod , only : fldchk => med_methods_FB_FldChk
use med_internalstate_mod , only : InternalState
use med_internalstate_mod , only : mapbilnr, mapconsf, mapconsd, mappatch
use med_internalstate_mod , only : mapfcopy, mapnstod, mapnstod_consd
use med_internalstate_mod , only : mapfillv_bilnr
use med_internalstate_mod , only : mapnstod_consf
use med_internalstate_mod , only : mapbilnr_nstod
use esmFlds , only : addmap_from => med_fldList_addmap_from
use esmFlds , only : addmrg_to => med_fldList_addmrg_to
! input/output parameters:
type(ESMF_GridComp) :: gcomp
character(len=*) , intent(in) :: phase
integer , intent(inout) :: rc
! local variables:
type(InternalState) :: is_local
integer :: n
character(len=CS) :: fldname
character(len=CS) :: fldname1, fldname2
type(gcomp_attr) :: coastal_attr
character(len=CS), allocatable :: S_flds(:)
character(len=CS), allocatable :: F_flds(:,:)
character(len=*) , parameter :: subname='(esmFldsExchange_coastal_init)'
!--------------------------------------
call ESMF_LogWrite(trim(subname)//": called", ESMF_LOGMSG_INFO)
rc = ESMF_SUCCESS
!---------------------------------------
! Get the internal state
!---------------------------------------
nullify(is_local%wrap)
call ESMF_GridCompGetInternalState(gcomp, is_local, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
!--------------------------------------
! Merging arguments:
! mrg_fromN = source component index that for the field to be merged
! mrg_fldN = souce field name to be merged
! mrg_typeN = merge type ('copy', 'copy_with_weights', 'sum',
! 'sum_with_weights', 'merge')
! NOTE:
! mrg_from(compmed) can either be for mediator computed fields for atm/ocn
! fluxes or for ocn albedos
!
! NOTE:
! FBMed_aoflux_o only refer to output fields to the atm/ocn that computed in
! the atm/ocn flux calculations. Input fields required from either the atm
! or the ocn for these computation will use the logical 'use_med_aoflux'
! below. This is used to determine mappings between the atm and ocn needed
! for these computations.
!--------------------------------------
!=====================================================================
! attribute settings
!=====================================================================
call esmFldsExchange_coastal_attr(gcomp, coastal_attr, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
!=====================================================================
! FIELDS TO OCEAN (compocn)
!=====================================================================
! ---------------------------------------------------------------------
! to ocn: state fields
! ---------------------------------------------------------------------
if (coastal_attr%atm_present .and. coastal_attr%ocn_present) then
allocate(S_flds(8))
S_flds = (/'Sa_u10m ', & ! inst_zonal_wind_height10m
'Sa_v10m ', & ! inst_merid_wind_height10m
'Sa_pslv ', & ! inst_pres_height_surface!
'Sa_t2m ', & ! inst_temp_height2m
'Sa_q2m ', & ! inst_spec_humid_height2m
'Faxa_lwdn ', & ! mean_down_lw_flx
'Faxa_swnet', & ! mean_net_sw_flx
'Faxa_rain ' /) ! mean_prec_rate
do n = 1,size(S_flds)
fldname = trim(S_flds(n))
if (fldchk(is_local%wrap%FBExp(compocn),trim(fldname),rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compatm,compatm),trim(fldname),rc=rc) &
) then
call addmap_from(compatm, trim(fldname), compocn, &
mapbilnr_nstod, coastal_attr%mapnorm, coastal_attr%atm2ocn_smap)
call addmrg_to(compocn, trim(fldname), &
mrg_from=compatm, mrg_fld=trim(fldname), mrg_type='copy')
end if
end do
deallocate(S_flds)
end if
! ---------------------------------------------------------------------
! to ocn: wave fields
! ---------------------------------------------------------------------
if (coastal_attr%wav_present .and. coastal_attr%ocn_present) then
allocate(S_flds(3))
S_flds = (/'Sw_wavsuu', & ! eastward_wave_radiation_stress
'Sw_wavsuv', & ! eastward_northward_wave_radiation_stress
'Sw_wavsvv' /) ! northward_wave_radiation_stress
do n = 1,size(S_flds)
fldname = trim(S_flds(n))
if (fldchk(is_local%wrap%FBExp(compocn),trim(fldname),rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav,compwav),trim(fldname),rc=rc) &
) then
call addmap_from(compwav, trim(fldname), compocn, &
mapbilnr_nstod, coastal_attr%mapnorm, coastal_attr%wav2ocn_smap)
call addmrg_to(compocn, trim(fldname), &
mrg_from=compwav, mrg_fld=trim(fldname), mrg_type='copy')
end if
end do
deallocate(S_flds)
end if
!=====================================================================
! FIELDS TO WAVE (compwav)
!=====================================================================
! ---------------------------------------------------------------------
! to wav: state fields
! ---------------------------------------------------------------------
if (coastal_attr%atm_present .and. coastal_attr%wav_present) then
allocate(S_flds(2))
S_flds = (/'Sa_u10m', & ! inst_zonal_wind_height10m
'Sa_v10m' /) ! inst_merid_wind_height10m
do n = 1,size(S_flds)
fldname = trim(S_flds(n))
if (fldchk(is_local%wrap%FBExp(compwav),trim(fldname),rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compatm,compatm),trim(fldname),rc=rc) &
) then
call addmap_from(compatm, trim(fldname), compwav, &
mapbilnr_nstod, coastal_attr%mapnorm, coastal_attr%atm2wav_smap)
call addmrg_to(compwav, trim(fldname), &
mrg_from=compatm, mrg_fld=trim(fldname), mrg_type='copy')
end if
end do
deallocate(S_flds)
end if
! ---------------------------------------------------------------------
! to wav: ocean fields
! ---------------------------------------------------------------------
if (coastal_attr%atm_present .and. coastal_attr%wav_present) then
allocate(S_flds(2))
S_flds = (/'So_u', & ! ocn_current_zonal
'So_v' /) ! ocn_current_merid
do n = 1,size(S_flds)
fldname = trim(S_flds(n))
if (fldchk(is_local%wrap%FBExp(compwav),trim(fldname),rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compocn,compocn),trim(fldname),rc=rc) &
) then
call addmap_from(compocn, trim(fldname), compwav, &
mapbilnr_nstod, coastal_attr%mapnorm, coastal_attr%ocn2wav_smap)
call addmrg_to(compwav, trim(fldname), &
mrg_from=compocn, mrg_fld=trim(fldname), mrg_type='copy')
end if
end do
deallocate(S_flds)
end if
call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO)
end subroutine esmFldsExchange_coastal_init
!-----------------------------------------------------------------------------
subroutine esmFldsExchange_coastal_attr(gcomp, coastal_attr, rc)
! input/output parameters:
type(ESMF_GridComp) :: gcomp
type(gcomp_attr) , intent(inout) :: coastal_attr
integer , intent(inout) :: rc
! local variables:
character(32) :: cname
integer :: verbosity, diagnostic
character(len=CL) :: cvalue
logical :: isPresent, isSet
character(len=*) , parameter :: subname='(esmFldsExchange_coastal_attr)'
!--------------------------------------
call ESMF_LogWrite(trim(subname)//": called", ESMF_LOGMSG_INFO)
rc = ESMF_SUCCESS
! Query component for name, verbosity, and diagnostic values
call NUOPC_CompGet(gcomp, name=cname, verbosity=verbosity, &
diagnostic=diagnostic, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
!----------------------------------------------------------
! Component active or not?
!----------------------------------------------------------
call NUOPC_CompAttributeGet(gcomp, name='ATM_model', &
value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (isPresent .and. isSet) then
if (trim(cvalue) /= 'satm') coastal_attr%atm_present = .true.
end if
call NUOPC_CompAttributeGet(gcomp, name='OCN_model', &
value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (isPresent .and. isSet) then
if (trim(cvalue) /= 'socn') coastal_attr%ocn_present = .true.
end if
call NUOPC_CompAttributeGet(gcomp, name='WAV_model', &
value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (isPresent .and. isSet) then
if (trim(cvalue) /= 'swav') coastal_attr%wav_present = .true.
end if
!----------------------------------------------------------
! Normalization type
!----------------------------------------------------------
call NUOPC_CompAttributeGet(gcomp, name='normalization', &
isPresent=isPresent, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (isPresent) then
call NUOPC_CompAttributeGet(gcomp, name='normalization', &
value=coastal_attr%mapnorm, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if
!----------------------------------------------------------
! Initialize mapping file names
!----------------------------------------------------------
! to atm
call NUOPC_CompAttributeGet(gcomp, name='ocn2atm_smapname', &
isPresent=isPresent, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (isPresent) then
call NUOPC_CompAttributeGet(gcomp, name='ocn2atm_smapname', &
value=coastal_attr%ocn2atm_smap, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if
call NUOPC_CompAttributeGet(gcomp, name='ocn2atm_fmapname', &
isPresent=isPresent, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (isPresent) then
call NUOPC_CompAttributeGet(gcomp, name='ocn2atm_fmapname', &
value=coastal_attr%ocn2atm_fmap, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if
! to ocn
call NUOPC_CompAttributeGet(gcomp, name='atm2ocn_fmapname', &
isPresent=isPresent, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (isPresent) then
call NUOPC_CompAttributeGet(gcomp, name='atm2ocn_fmapname', &
value=coastal_attr%atm2ocn_fmap, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if
call NUOPC_CompAttributeGet(gcomp, name='atm2ocn_smapname', &
isPresent=isPresent, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (isPresent) then
call NUOPC_CompAttributeGet(gcomp, name='atm2ocn_smapname', &
value=coastal_attr%atm2ocn_smap, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if
call NUOPC_CompAttributeGet(gcomp, name='atm2ocn_vmapname', &
isPresent=isPresent, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (isPresent) then
call NUOPC_CompAttributeGet(gcomp, name='atm2ocn_vmapname', &
value=coastal_attr%atm2ocn_vmap, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if
! to wav
call NUOPC_CompAttributeGet(gcomp, name='atm2wav_smapname', &
isPresent=isPresent, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (isPresent) then
call NUOPC_CompAttributeGet(gcomp, name='atm2wav_smapname', &
value=coastal_attr%atm2wav_smap, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if
call NUOPC_CompAttributeGet(gcomp, name='ocn2wav_smapname', &
isPresent=isPresent, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (isPresent) then
call NUOPC_CompAttributeGet(gcomp, name='ocn2wav_smapname', &
value=coastal_attr%ocn2wav_smap, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if
! Log Attribute Settings
if (btest(verbosity,16)) then
write(cvalue,"(I0)") verbosity
call ESMF_LogWrite(trim(subname)//': Verbosity = '// &
trim(cvalue), ESMF_LOGMSG_INFO)
write(cvalue,"(I0)") diagnostic
call ESMF_LogWrite(trim(subname)//': Diagnostic = '// &
trim(cvalue), ESMF_LOGMSG_INFO)
call ESMF_LogWrite(trim(subname)//': normalization = '// &
trim(coastal_attr%mapnorm), ESMF_LOGMSG_INFO)
call ESMF_LogWrite(trim(subname)//': ocn2atm_smapname = '// &
trim(coastal_attr%ocn2atm_smap), ESMF_LOGMSG_INFO)
call ESMF_LogWrite(trim(subname)//': ocn2atm_fmapname = '// &
trim(coastal_attr%ocn2atm_fmap), ESMF_LOGMSG_INFO)
call ESMF_LogWrite(trim(subname)//': atm2ocn_fmapname = '// &
trim(coastal_attr%atm2ocn_fmap), ESMF_LOGMSG_INFO)
call ESMF_LogWrite(trim(subname)//': atm2ocn_smapname = '// &
trim(coastal_attr%atm2ocn_smap), ESMF_LOGMSG_INFO)
call ESMF_LogWrite(trim(subname)//': atm2ocn_vmapname = '// &
trim(coastal_attr%atm2ocn_vmap), ESMF_LOGMSG_INFO)
endif
call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO)
end subroutine esmFldsExchange_coastal_attr
end module esmFldsExchange_coastal_mod