-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPU Path optimizations #9
Changes from 250 commits
ff4340a
56ea3b2
e5d2b06
03d9977
1f4ac75
0f081b7
d03e67b
2b07cf9
e415b09
4ce3772
184350b
6f694a7
c9bdc9e
784e623
66731ed
5de8ed5
4676c9c
a575ed2
cb109d5
cf90e4d
2ae19b9
75b74c4
baa42be
2de7adf
aac7e2a
dda2816
7606b23
5230b16
18c0e99
6416140
77ce5c2
db141f8
9bf4f7b
92a8131
9217c28
5df2a7b
60a0e8e
5326ba6
6a4652c
13f4c3a
0698f15
5afa4aa
9e2bd80
b1ca5b9
cdeae31
5d3c0d8
365eb74
afc7380
11497e6
729ff7c
22b06bc
868d88d
f7ab48f
c2f828d
9158587
6be9c7c
8d63730
56de657
5592d71
93eb16a
cbde347
cd05641
4fe9543
8c93b89
d9c28ac
faea503
c33af42
a79f8fc
5bdaa71
531ba2f
33f2b05
3cc867c
7c7300e
a65fbf6
97bbf8b
f0b5e5c
e688ab3
d061744
5154a76
b8a09c6
79dc709
77748f4
6048053
0fb20ea
ec7e47d
78514a5
7bf22c0
f5b47a2
be78530
e99a030
8a79c6a
d189d72
29dd4c3
2951caa
8b60f83
4328cbf
27bdcfd
f77daa3
fe1cee4
57a5e60
2a4a6fd
7887b0d
3b66b49
6445bc1
40d7596
9d2e2b3
a571122
b28ad84
6000cce
d692ed5
67263d7
3458066
699cf3e
7574013
8f4a7d3
77b7658
38d98aa
e076def
983769c
cac89b3
c507767
9dfdc88
958d0f8
8d4f385
740075f
a6873aa
34f5c63
93746eb
dc3c6f2
16e4320
cfb03c3
93158d1
4f0f9b4
4994f31
92e080f
f8938df
1182224
d4b5a41
57febf9
3de130e
34c3106
56efaf5
9deea48
5eb4bc5
41c098b
b529aa3
337d453
8280e2c
3b498fe
a3f7d5f
3d8d069
8f57633
a8870cc
65d5b30
d0eed6e
41a57d4
7b6af6c
b043081
b93c6a1
c62aa33
3aef241
3a369cd
50952c4
3ee8454
a3043d9
930168a
bf6e607
e6506d0
6089809
2d1b671
b05f2b7
dfcc932
41fc8fe
b44baa6
96889cc
ba65812
31dc1d0
7362996
b3e0625
8936ce0
10d0883
5ffc23e
63cf518
40ab86a
353e6e8
e0008ed
832dce1
8ecc13d
69f12ce
6c28dd6
29e1a45
48962f0
fc419af
a69c969
0396062
08a53cc
715a1d6
3fd83ff
19d31f0
43d5294
4762963
0352bf7
665c81a
547315b
171e43f
363e7da
bd5e907
fec161f
d2607da
2576d41
e5fbb9e
c3181dd
0475c8f
30c9ece
36581de
057c4c3
6d4ccc2
1a779dc
e9dde3b
4e379be
8869d26
bd03377
4c3fa0e
3aa054c
de1ef2e
2d30553
0a1177e
bd09839
7f12a1c
4499c26
a9f8892
dd71da0
1f747f1
5b0af2a
e137897
974069d
eb7e29b
187d17f
14b7f03
cbbb666
fcf48ca
f42b15b
7b7b7b3
2ac1b3b
c771877
d7f8b37
b2953e4
bcae6f9
a017a5b
19b4d13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# (C) Copyright 2020- ECMWF. | ||
# (C) Copyright 2022- NVIDIA. | ||
# | ||
# This software is licensed under the terms of the Apache Licence Version 2.0 | ||
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
|
@@ -25,20 +26,16 @@ if( HAVE_TOOLS AND TARGET eccodes_f90 ) | |
LIBS ${trans} eccodes_f90 | ||
LINKER_LANGUAGE Fortran | ||
DEFINITIONS ECTRANS_TOOLS_RTABLE_PATH="${ECTRANS_TOOLS_RTABLE_PATH}" ) | ||
|
||
endforeach() | ||
|
||
|
||
endif() | ||
|
||
|
||
set( HAVE_dp ${HAVE_DOUBLE_PRECISION} ) | ||
set( HAVE_sp ${HAVE_SINGLE_PRECISION} ) | ||
|
||
if( HAVE_GPU ) | ||
foreach( prec sp dp ) | ||
if( HAVE_${prec} ) | ||
ecbuild_add_executable(TARGET driver-spectrans-${prec} | ||
ecbuild_add_executable(TARGET driver-spectrans-CA-${prec} | ||
SOURCES driver-spectraltransform.F90 | ||
INCLUDES | ||
${MPI_Fortran_INCLUDE_PATH} | ||
|
@@ -47,14 +44,18 @@ if( HAVE_GPU ) | |
fiat parkind_${prec} | ||
eccodes_f90 eccodes_memfs | ||
${MPI_Fortran_LIBRARIES} | ||
trans_gpu_static_${prec} | ||
trans_gpu_static_CA_${prec} | ||
gpu | ||
OpenACC::OpenACC_Fortran | ||
${LAPACK_LIBRARIES} | ||
nvhpcwrapnvtx | ||
) | ||
ecbuild_add_executable(TARGET driver-spectrans-CA-${prec} | ||
SOURCES driver-spectraltransform.F90 | ||
set_property( TARGET driver-spectrans-CA-${prec} PROPERTY CUDA_ARCHITECTURES 70 ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CMake changes are just to make it work for me! I don't see myself as a ecbuild expert; and I think there have been changes in master. |
||
target_compile_options( driver-spectrans-CA-${prec} PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:-g -acc -Minfo=acc -gpu=cc70,lineinfo,deepcopy,fastmath,nordc,pinned -cudalib=cufft,cublas -fpic> ) | ||
set_target_properties(driver-spectrans-CA-${prec} PROPERTIES LINK_FLAGS "-acc -cudalib=cufft,cublas -fpic -gpu=cc70,pinned") | ||
|
||
ecbuild_add_executable(TARGET driver-spectrans-CA-${prec}-indiv | ||
SOURCES driver-spectraltransform_indiv.F90 | ||
INCLUDES | ||
${MPI_Fortran_INCLUDE_PATH} | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../trans/gpu/include/ectrans> | ||
|
@@ -68,17 +69,9 @@ if( HAVE_GPU ) | |
${LAPACK_LIBRARIES} | ||
nvhpcwrapnvtx | ||
) | ||
#trans_gpu_static_${prec} | ||
#gpu | ||
#${CMAKE_BINARY_DIR}/lib/libtrans_gpu_static_${prec}.a | ||
#${CMAKE_BINARY_DIR}/lib/libgpu.a | ||
#target_link_libraries( driver-spectrans PRIVATE OpenACC::OpenACC_Fortran ) | ||
set_property( TARGET driver-spectrans-${prec} PROPERTY CUDA_ARCHITECTURES 70 ) | ||
set_property( TARGET driver-spectrans-CA-${prec} PROPERTY CUDA_ARCHITECTURES 70 ) | ||
target_compile_options( driver-spectrans-${prec} PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:-g -acc -Minfo=acc -gpu=cc70,lineinfo,deepcopy,fastmath,nordc -cudalib=cufft,cublas -fpic> ) | ||
target_compile_options( driver-spectrans-CA-${prec} PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:-g -acc -Minfo=acc -gpu=cc70,lineinfo,deepcopy,fastmath,nordc -cudalib=cufft,cublas -fpic> ) | ||
set_target_properties(driver-spectrans-${prec} PROPERTIES LINK_FLAGS "-acc -cudalib=cufft,cublas -fpic") | ||
set_target_properties(driver-spectrans-CA-${prec} PROPERTIES LINK_FLAGS "-acc -cudalib=cufft,cublas -fpic") | ||
set_property( TARGET driver-spectrans-CA-${prec}-indiv PROPERTY CUDA_ARCHITECTURES 70 ) | ||
target_compile_options( driver-spectrans-CA-${prec}-indiv PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:-g -acc -Minfo=acc -gpu=cc70,lineinfo,deepcopy,fastmath,nordc,pinned -cudalib=cufft,cublas -fpic> ) | ||
set_target_properties(driver-spectrans-CA-${prec}-indiv PROPERTIES LINK_FLAGS "-acc -cudalib=cufft,cublas -fpic -gpu=cc70,pinned") | ||
message("Building ${prec} GPU driver") | ||
endif() | ||
endforeach() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
! (C) Copyright 2014- ECMWF. | ||
! (C) Copyright 2022- NVIDIA. | ||
! | ||
! This software is licensed under the terms of the Apache Licence Version 2.0 | ||
! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
|
@@ -76,13 +77,17 @@ PROGRAM TRANSFORM_TEST | |
REAL(KIND=JPRB), POINTER :: ZT(:,:,:) => NULL() | ||
REAL(KIND=JPRB), ALLOCATABLE :: ZSP(:,:) | ||
|
||
REAL(KIND=JPRB),ALLOCATABLE :: PAVE(:) | ||
REAL(KIND=JPRB),ALLOCATABLE :: PMIN(:) | ||
REAL(KIND=JPRB),ALLOCATABLE :: PMAX(:) | ||
|
||
LOGICAL :: LSTACK | ||
LOGICAL :: LDONE,LSTDEV | ||
LOGICAL :: LUSERPNM, LKEEPRPNM, LUSEFLT | ||
LOGICAL :: LTRACE_STATS,LSTATS_OMP, LSTATS_COMMS, LSTATS_MPL | ||
LOGICAL :: LSTATS,LBARRIER_STATS, LBARRIER_STATS2, LDETAILED_STATS | ||
LOGICAL :: LSTATS_ALLOC, LSYNCSTATS, LSTATSCPU, LSTATS_MEM | ||
LOGICAL :: LXML_STATS | ||
LOGICAL :: LXML_STATS, LDUMP | ||
LOGICAL :: LFFTW | ||
INTEGER(KIND=JPIM) :: NSTATS_MEM, NTRACE_STATS, NPRNT_STATS | ||
! 0 - no output, 1 - init and final result, 2 - every timestep | ||
|
@@ -140,14 +145,15 @@ PROGRAM TRANSFORM_TEST | |
& LUSERPNM, LKEEPRPNM, LUSEFLT, NQ, NLIN, IMAX_FLDS_IN, & | ||
& NPRINTNORMS, ITERS, ZMAXERR_CHECK, NPROMA, NPROMATR, LEQ_REGIONS, & | ||
& NPRINTLEV, NPRTRW, NPRTRV, NSPECRESMIN, NFLEVG, MBX_SIZE, LSTACK, & | ||
& LFFTW | ||
& LFFTW, LDUMP | ||
|
||
! ------------------------------------------------------------------ | ||
|
||
#include "setup_trans0.h" | ||
#include "setup_trans.h" | ||
#include "inv_trans.h" | ||
#include "dir_trans.h" | ||
#include "gpnorm_trans.h" | ||
#include "dist_spec.h" | ||
#include "gath_grid.h" | ||
#include "trans_inq.h" | ||
|
@@ -200,6 +206,7 @@ PROGRAM TRANSFORM_TEST | |
LBARRIER_STATS2=.FALSE. | ||
LSTATSCPU=.FALSE. | ||
LSYNCSTATS=.FALSE. | ||
LDUMP=.TRUE. | ||
LXML_STATS=.FALSE. | ||
LTRACE_STATS=.FALSE. | ||
NSTATS_MEM=0 | ||
|
@@ -243,7 +250,7 @@ PROGRAM TRANSFORM_TEST | |
! Participating processors limited by -P option | ||
|
||
!-------------------------- | ||
CALL MPL_INIT() | ||
CALL MPL_INIT(LDENV=.false.) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if this is a problem for you in some case but propagating the full environment is a bad thing if we run with nsys (because it sets some per-rank environment variables) |
||
!IF( LSTATS ) CALL GSTATS(0,0) | ||
ZTINIT=TIMEF() | ||
|
||
|
@@ -308,7 +315,11 @@ PROGRAM TRANSFORM_TEST | |
IF( NPRTRV*NPRTRW /= NPROC ) CYCLE | ||
IF( NPRTRV > NPRTRW ) EXIT | ||
IF( NPRTRW > NSPECRESMIN ) CYCLE | ||
! With CUDA AWARE MPI we don't need any OpenMP so there is no need for this! Effectively this is even | ||
! undesireable because it may trigger different domain decompositions for no reasons on different machines | ||
#ifndef USE_CUDA_AWARE_MPI_FT | ||
IF( NPRTRW <= NSPECRESMIN/(2*OML_MAX_THREADS()) ) EXIT | ||
#endif | ||
ENDDO | ||
! GO FOR APPROX SQUARE PARTITION FOR BACKUP | ||
IF( NPRTRV*NPRTRW /= NPROC .OR. NPRTRW > NSPECRESMIN .OR. NPRTRV > NPRTRW ) THEN | ||
|
@@ -771,6 +782,10 @@ PROGRAM TRANSFORM_TEST | |
ALLOCATE(ZGMV(NPROMA,NFLEVG,NDIMGMV,NGPBLKS)) | ||
ALLOCATE(ZGMVS(NPROMA,NDIMGMVS,NGPBLKS)) | ||
|
||
ALLOCATE(PMIN(NFLEVG)) | ||
ALLOCATE(PMAX(NFLEVG)) | ||
ALLOCATE(PAVE(NFLEVG)) | ||
|
||
ALLOCATE(ZNORMSP(1)) | ||
ALLOCATE(ZNORMSP1(1)) | ||
ALLOCATE(ZNORMVOR(NFLEVG)) | ||
|
@@ -857,10 +872,9 @@ PROGRAM TRANSFORM_TEST | |
ZTSTEP1(JSTEP)=(TIMEF()-ZTSTEP1(JSTEP))/1000.0_JPRD | ||
|
||
! Dump a field to a binary file | ||
CALL DUMP_GRIDPOINT_FIELD(JSTEP, MYPROC, NPROMA, NGPBLKS, ZGMVS(:,1,:), 'S', NOUTDUMP) | ||
CALL DUMP_GRIDPOINT_FIELD(JSTEP, MYPROC, NPROMA, NGPBLKS, ZWINDS(:,NFLEVG,3,:), 'U', NOUTDUMP) | ||
CALL DUMP_GRIDPOINT_FIELD(JSTEP, MYPROC, NPROMA, NGPBLKS, ZWINDS(:,NFLEVG,4,:), 'V', NOUTDUMP) | ||
CALL DUMP_GRIDPOINT_FIELD(JSTEP, MYPROC, NPROMA, NGPBLKS, ZGMV(:,NFLEVG,5,:), 'T', NOUTDUMP) | ||
IF (LDUMP) CALL DUMP_GRIDPOINT_FIELD_3D(JSTEP, MYPROC, ZGMVS(:,:,:), 'S', NOUTDUMP) | ||
IF (LDUMP) CALL DUMP_GRIDPOINT_FIELD_4D(JSTEP, MYPROC, ZWINDS(:,:,:,:), 'W', NOUTDUMP) | ||
IF (LDUMP) CALL DUMP_GRIDPOINT_FIELD_4D(JSTEP, MYPROC, ZGMV(:,:,:,:), 'M', NOUTDUMP) | ||
|
||
ZTSTEP2(JSTEP)=TIMEF() | ||
CALL DIR_TRANS(PSPVOR=ZVOR,PSPDIV=ZDIV,& | ||
|
@@ -871,6 +885,12 @@ PROGRAM TRANSFORM_TEST | |
& PGP3A=ZGMV(:,:,5:5,:)) | ||
ZTSTEP2(JSTEP)=(TIMEF()-ZTSTEP2(JSTEP))/1000.0_JPRD | ||
|
||
! Dump a field to a binary file | ||
IF (LDUMP) CALL DUMP_GRIDPOINT_FIELD_2D(JSTEP, MYPROC, ZVOR(:,:), 'V', NOUTDUMP) | ||
IF (LDUMP) CALL DUMP_GRIDPOINT_FIELD_2D(JSTEP, MYPROC, ZDIV(:,:), 'D', NOUTDUMP) | ||
IF (LDUMP) CALL DUMP_GRIDPOINT_FIELD_2D(JSTEP, MYPROC, ZSP(:,:), 'P', NOUTDUMP) | ||
IF (LDUMP) CALL DUMP_GRIDPOINT_FIELD_3D(JSTEP, MYPROC, ZT(:,:,:), 'T', NOUTDUMP) | ||
|
||
ZTSTEP(JSTEP)=(TIMEF()-ZTSTEP(JSTEP))/1000.0_JPRD | ||
|
||
ZTSTEPAVG=ZTSTEPAVG+ZTSTEP(JSTEP) | ||
|
@@ -921,8 +941,32 @@ PROGRAM TRANSFORM_TEST | |
ELSE | ||
WRITE(NOUT,'("time step ",I6," took", F8.4)') JSTEP,ZTSTEP(JSTEP) | ||
ENDIF | ||
flush(nout) | ||
! call acc_present_dump() | ||
! print *, "going to free in 3 seconds" | ||
! call sleep (1) | ||
! print *, "going to free in 2 seconds" | ||
! call sleep (1) | ||
! print *, "going to free in 1 seconds" | ||
! call sleep (1) | ||
! !call acc_clear_freelists() | ||
! call sleep (5) | ||
! !call acc_present_dump() | ||
! !call sleep (10000) | ||
ENDDO | ||
|
||
CALL GPNORM_TRANS(ZWINDS(:,:,2,:),NFLEVG,KPROMA=NPROMA,PAVE=PAVE,PMIN=PMIN,PMAX=PMAX,LDAVE_ONLY=.false.,KRESOL=1) | ||
if (myproc == 1) then | ||
OPEN(800+myproc, FORM="UNFORMATTED") | ||
write(800+myproc) "pave", sum(pave)/size(pave) | ||
write(800+myproc) "pmin", sum(pmin)/size(pmin) | ||
write(800+myproc) "pmax", sum(pmax)/size(pmax) | ||
close(800+myproc) | ||
print *, "pave", sum(pave)/size(pave) | ||
print *, "pmin", sum(pmin)/size(pmin) | ||
print *, "pmax", sum(pmax)/size(pmax) | ||
endif | ||
|
||
ZTLOOP=(TIMEF()-ZTLOOP)/1000.0_JPRD | ||
|
||
WRITE(NOUT,'(" ")') | ||
|
@@ -1266,28 +1310,77 @@ SUBROUTINE SORT(A, N) | |
|
||
! ------------------------------------------------------------------ | ||
|
||
SUBROUTINE DUMP_GRIDPOINT_FIELD(JSTEP, MYPROC, NPROMA, NGPBLKS, FLD, FLDCHAR, NOUTDUMP) | ||
SUBROUTINE DUMP_GRIDPOINT_FIELD_2D(JSTEP, MYPROC, FLD, FLDCHAR, NOUTDUMP) | ||
|
||
! Dump a 2D field to a binary file. | ||
|
||
INTEGER(KIND=JPIM), INTENT(IN) :: JSTEP ! Time step, used for naming file | ||
INTEGER(KIND=JPIM), INTENT(IN) :: MYPROC ! MPI rank, used for naming file | ||
INTEGER(KIND=JPIM), INTENT(IN) :: NPROMA ! Size of NPROMA | ||
INTEGER(KIND=JPIM), INTENT(IN) :: NGPBLKS ! Number of NPROMA blocks | ||
REAL(KIND=JPRB) , INTENT(IN) :: FLD(NPROMA,NGPBLKS) ! 2D field | ||
REAL(KIND=JPRB) , INTENT(IN) :: FLD(:,:) ! 2D field | ||
CHARACTER , INTENT(IN) :: FLDCHAR ! Single character field identifier | ||
INTEGER(KIND=JPIM), INTENT(IN) :: NOUTDUMP ! Unit number for output file | ||
|
||
CHARACTER(LEN=14) :: FILENAME = "X.XXX.XXXX.dat" | ||
CHARACTER(LEN=60) :: DUMP_DIR | ||
|
||
WRITE(FILENAME(1:1),'(A1)') FLDCHAR | ||
WRITE(FILENAME(3:5),'(I3.3)') JSTEP | ||
WRITE(FILENAME(7:10),'(I4.4)') MYPROC | ||
|
||
CALL GETENV("DUMP_DIR", DUMP_DIR) | ||
IF (TRIM(DUMP_DIR) == "") CALL GETCWD(DUMP_DIR) | ||
OPEN(NOUTDUMP, FILE=TRIM(DUMP_DIR)//'/'//FILENAME, FORM="UNFORMATTED") | ||
WRITE(NOUTDUMP) FLD | ||
CLOSE(NOUTDUMP) | ||
|
||
END SUBROUTINE DUMP_GRIDPOINT_FIELD_2D | ||
SUBROUTINE DUMP_GRIDPOINT_FIELD_3D(JSTEP, MYPROC, FLD, FLDCHAR, NOUTDUMP) | ||
|
||
! Dump a 3D field to a binary file. | ||
|
||
INTEGER(KIND=JPIM), INTENT(IN) :: JSTEP ! Time step, used for naming file | ||
INTEGER(KIND=JPIM), INTENT(IN) :: MYPROC ! MPI rank, used for naming file | ||
REAL(KIND=JPRB) , INTENT(IN) :: FLD(:,:,:) ! 3D field | ||
CHARACTER , INTENT(IN) :: FLDCHAR ! Single character field identifier | ||
INTEGER(KIND=JPIM), INTENT(IN) :: NOUTDUMP ! Unit number for output file | ||
|
||
CHARACTER(LEN=14) :: FILENAME = "X.XXX.XXXX.dat" | ||
CHARACTER(LEN=60) :: DUMP_DIR | ||
|
||
WRITE(FILENAME(1:1),'(A1)') FLDCHAR | ||
WRITE(FILENAME(3:5),'(I3.3)') JSTEP | ||
WRITE(FILENAME(7:10),'(I4.4)') MYPROC | ||
|
||
CALL GETENV("DUMP_DIR", DUMP_DIR) | ||
IF (TRIM(DUMP_DIR) == "") CALL GETCWD(DUMP_DIR) | ||
OPEN(NOUTDUMP, FILE=TRIM(DUMP_DIR)//'/'//FILENAME, FORM="UNFORMATTED") | ||
WRITE(NOUTDUMP) FLD | ||
CLOSE(NOUTDUMP) | ||
|
||
END SUBROUTINE DUMP_GRIDPOINT_FIELD_3D | ||
SUBROUTINE DUMP_GRIDPOINT_FIELD_4D(JSTEP, MYPROC, FLD, FLDCHAR, NOUTDUMP) | ||
|
||
! Dump a 4D field to a binary file. | ||
|
||
INTEGER(KIND=JPIM), INTENT(IN) :: JSTEP ! Time step, used for naming file | ||
INTEGER(KIND=JPIM), INTENT(IN) :: MYPROC ! MPI rank, used for naming file | ||
REAL(KIND=JPRB) , INTENT(IN) :: FLD(:,:,:,:) ! 4D field | ||
CHARACTER , INTENT(IN) :: FLDCHAR ! Single character field identifier | ||
INTEGER(KIND=JPIM), INTENT(IN) :: NOUTDUMP ! Unit number for output file | ||
|
||
CHARACTER(LEN=14) :: FILENAME = "X.XXX.XXXX.dat" | ||
CHARACTER(LEN=60) :: DUMP_DIR | ||
|
||
WRITE(FILENAME(1:1),'(A1)') FLDCHAR | ||
WRITE(FILENAME(3:5),'(I3.3)') JSTEP | ||
WRITE(FILENAME(7:10),'(I4.4)') MYPROC | ||
|
||
OPEN(NOUTDUMP, FILE=FILENAME, FORM="UNFORMATTED") | ||
WRITE(NOUTDUMP) RESHAPE(FLD, (/ NPROMA*NGPBLKS /)) | ||
CALL GETENV("DUMP_DIR", DUMP_DIR) | ||
IF (TRIM(DUMP_DIR) == "") CALL GETCWD(DUMP_DIR) | ||
OPEN(NOUTDUMP, FILE=TRIM(DUMP_DIR)//'/'//FILENAME, FORM="UNFORMATTED") | ||
WRITE(NOUTDUMP) FLD | ||
CLOSE(NOUTDUMP) | ||
|
||
END SUBROUTINE DUMP_GRIDPOINT_FIELD | ||
END SUBROUTINE DUMP_GRIDPOINT_FIELD_4D | ||
|
||
END PROGRAM TRANSFORM_TEST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case you wonder - I just sorted this file when adding myself to the contributors because the file tells us it should be sorted.