schism-dev / schism-esmf

Earth System Modeling Framework cap for SCHISM
5 stars 6 forks source link

"%farrayPtr2" is not defined yet in schism_esmf_util.F90 #8

Closed platipodium closed 2 years ago

platipodium commented 2 years ago

(reported by @danishyo )

I test your latest push (b1ac7cf) on frontera with large domain case.

The code can only be successfully compile after modifying the following in schism_esmf_util.F90,

Comment line 179~183 for uu2 & vv2, it looks like "%farrayPtr2" is not defined yet. Comment line 1622 and uncomment 1620& 1621 to instead, I try "ESMF_TimeSetString" for line 1622, but get "undefined reference error".

The test still shows similar error (index is out of range) like before, the following error messages constantly show in some PET files.

20220524 135200.829 INFO PET0563 schism_002 mesh with matching number of augmented npa= 1058, owned= 889 and foreign= 169 nodes 20220524 135200.830 INFO PET0563 schism_002 created mesh from 1058/ 899 nodes with 889 own and 169 foreign 20220524 135200.868 INFO PET0563 schism_002 added to mesh from 1923 augmented and 1540 resident elements 1923 owned elements 20220524 135200.868 INFO PET0563 schism_002 added mesh to component 20220524 135200.869 INFO PET0563 schism_002 created export field "mesh_global_node_id" on nodes 20220524 135200.869 INFO PET0563 schism_002 created export field "mesh_global_element_id" on elements 20220524 135200.869 INFO PET0563 schism_002 created export field "mesh_element_node_connectivity" on elements 20220524 135200.869 ERROR PET0563 ESMCI_Array.C:1095 ESMCI::Array::create() Value unrecognized or out of range - LocalArray does not match requested element count 20220524 135200.869 ERROR PET0563 ESMCI_Array_F.C:79 c_esmc_arraycreatelocalarray() Value unrecognized or out of range - Internal subroutine call returned Error 20220524 135200.869 ERROR PET0563 ESMF_ArrayCreate.F90:25453 ESMF_ArrayCreateLocalArray() Value unrecognized or out of range - Internal subroutine call returned Error 20220524 135200.869 ERROR PET0563 ESMF_ArrayCreate.F90:2494 ESMF_ArrayCreateFrmPtr Value unrecognized or out of range - Internal subroutine call returned Error 20220524 135200.869 ERROR PET0563 ESMF_FieldEmpty.F90:59442 ESMF_FieldEmptyCompGBPtr Value unrecognized or out of range - Internal subroutine call returned Error 20220524 135200.869 ERROR PET0563 ESMF_FieldCreate.F90:5363 ESMF_FieldCreateGBDataPtr Value unrecognized or out of range - Internal subroutine call returned Error 20220524 135200.869 ERROR PET0563 ESMF_FieldCreate.F90:25207 ESMF_FieldCreateMeshDataPtr Value unrecognized or out of range - Internal subroutine call returned Error 20220524 135200.869 ERROR PET0563 schism_esmf_cap.F90:458 InitializeP1 Value unrecognized or out of range - SCHISM subroutine call returned error 20220524 135200.869 INFO PET0563 Finalizing ESMF

platipodium commented 2 years ago

Comment line 179~183 for uu2 & vv2, it looks like "%farrayPtr2" is not defined yet.

farrayPtr2 should be defined a part of the type_PtrMap

  type type_PtrMap
#ifndef ESMF_NO_SEQUENCE
    sequence 
#endif
    real(ESMF_KIND_I4), pointer  :: iarrayPtr1(:) => null()
    real(ESMF_KIND_R8), pointer  :: farrayPtr1(:) => null()
    real(ESMF_KIND_R8), pointer  :: farrayPtr2(:,:) => null()
    character(len=ESMF_MAXSTR)   :: name
  end type

it is then used in the statement

isPtr%wrap%ptrMap(7)%farrayPtr2 => uu2
platipodium commented 2 years ago

I cannot reproduce the problem @danishyo

Compiles fine on femto ESMF_8_3_0_beta_snapshot_06-14-g9f69d90 and strand ESMF_8_3_0_beta_snapshot_06

platipodium commented 2 years ago

Dealing with ptrMap here, for TimeString see #9 and for out of range error on mesh creation see #11

danishyo commented 2 years ago

I test with ESMF_8_1_0 & ESMF_8_2_0, compiling shows the following errors:

schism_esmf_util.F90(180): error #6796: The variable must have the TARGET attribute or be a subobject of an object with the TARGET attribute, or it must have the POINTER attribute. [UU2] isPtr%wrap%ptrMap(7)%farrayPtr2 => uu2 -------------------------------------^ schism_esmf_util.F90(183): error #6796: The variable must have the TARGET attribute or be a subobject of an object with the TARGET attribute, or it must have the POINTER attribute. [VV2] isPtr%wrap%ptrMap(8)%farrayPtr2 => vv2 -------------------------------------^ compilation aborted for schism_esmf_util.F90 (code 1) make[1]: *** [schism_esmf_util.o] Error 1

platipodium commented 2 years ago

We added TARGET attributes to uu2 and vv2 in schism_glbl.F90 late April.

684f03b8 (Carsten Lemmen    2022-04-29 21:09:25 +0200 438)   real(rkind),save,allocatable, target :: uu2(:,:),vv2(:,:),ww2(:,:)

does it help to upgrade your SCHISM?

danishyo commented 2 years ago

Thanks for the notice! After upgrade to latest SCHISM (f0daa0), compilation is OK with uu2 & vv2. However, test result still show same error (index is out of range).