The OASIS Coupler Forum

  HOME

compiling OASIS-MCT

Up to Installation and compilation

Posted by Anonymous at December 19 2023

Hello,
I want to compile OASIS-MCT so that i can couple WRF and CROCO model. But I am unbale to compile. I am using Ubuntu 20.04 version where g++ and gfortran version GNU(9.4.0). Can anyone help me by give me proper steps to compile OASIS MCT.

Posted by Anonymous at December 19 2023

Hi,

Steps to compile OASIS3-MCT are described in section 6.1 of the User Guide;
https://oasis.cerfacs.fr/wp-content/uploads/sites/114/2022/03/GLOBC_TR_Valcke_oasis3mct50_2021.pdf

You have to create a header Makefile adapted to your platform. I think there is no specific header Makefile for Ubuntu with the distribution but you should be able to create one. Maybe someone followng this forum will be able to answer you more precisely?

  With best regards,
  Sophie, for the oasis team

Posted by Anonymous at December 20 2023

Hello, 
When I try to compile showing error in 
Terminal: 
make[1]: *** [TopMakefileOasis3:246: makescrip-static] Error 2
make: *** [TopMakefileOasis3:93: static-libs-fortran] Error 2

in COMP.err:

  719 | 1120                 FORMAT ('      STORE add1,add2,blon,blat,ilon,ilat,WEIGHTS=', 1X,I8,1X,I8,1X,F12.8,1X,F12.8,1X,F12.8,1X,F12.8,1X, E16.8)
      |                                                                                                                                    1
Error: Line truncated at (1) [-Werror=line-truncation]
/home/awlad/oasis/oasis3-mct/lib/scrip/src/remap_conserv.F90:719:132:

  719 | 1120                 FORMAT ('      STORE add1,add2,blon,blat,ilon,ilat,WEIGHTS=', 1X,I8,1X,I8,1X,F12.8,1X,F12.8,1X,F12.8,1X,F12.8,1X, E16.8)
      |                                                                                                                                    1
Error: Unexpected element ‘\x00’ in format string at (1)
/home/awlad/oasis/oasis3-mct/lib/scrip/src/remap_conserv.F90:720:132:

  720 | 1121                 FORMAT ('      overlap STORE grid1_add, grid2_add, WEIGHTS=', 1X,I8,1X,I8,1X,F12.8,1X,F12.8,1X,F12.8,1X,F12.8,1X, E16.8)
      |                                                                                                                                    1
Error: Line truncated at (1) [-Werror=line-truncation]
/home/awlad/oasis/oasis3-mct/lib/scrip/src/remap_conserv.F90:720:132:

  720 | 1121                 FORMAT ('      overlap STORE grid1_add, grid2_add, WEIGHTS=', 1X,I8,1X,I8,1X,F12.8,1X,F12.8,1X,F12.8,1X,F12.8,1X, E16.8)
      |                                                                                                                                    1
Error: Unexpected element ‘\x00’ in format string at (1)
/home/awlad/oasis/oasis3-mct/lib/scrip/src/remap_conserv.F90:721:132:

  721 | 1122                 FORMAT ('      lfracnei STORE grid1_add, grid2_add, WEIGHTS=', 1X,I8,1X,I8,1X,F12.8,1X,F12.8,1X,F12.8,1X,F12.8,1X, E16.8)
      |                                                                                                                                    1
Error: Line truncated at (1) [-Werror=line-truncation]
/home/awlad/oasis/oasis3-mct/lib/scrip/src/remap_conserv.F90:721:132:

  721 | 1122                 FORMAT ('      lfracnei STORE grid1_add, grid2_add, WEIGHTS=', 1X,I8,1X,I8,1X,F12.8,1X,F12.8,1X,F12.8,1X,F12.8,1X, E16.8)
      |                                                                                                                                    1
Error: Unexpected end of format string in format string at (1)
/home/awlad/oasis/oasis3-mct/lib/scrip/src/remap_conserv.F90:728:119:

  728 |                               write(nulou,1120) grid1_add, grid2_add,beglon, beglat, intrsct_lon,intrsct_lat,weights(1)
      |                                                                                                                       1
Error: FORMAT label 1120 at (1) not defined
/home/awlad/oasis/oasis3-mct/lib/scrip/src/remap_conserv.F90:736:122:

  736 |                                  write(nulou,1121) grid1_add, grid2_add,beglon, beglat, intrsct_lon,intrsct_lat,weights(1)
      |                                                                                                                          1
Error: FORMAT label 1121 at (1) not defined
/home/awlad/oasis/oasis3-mct/lib/scrip/src/remap_conserv.F90:1340:119:

 1340 |                               write(nulou,1120) grid1_add, grid2_add,beglon, beglat, intrsct_lon,intrsct_lat,weights(1)
      |                                                                                                                       1
Error: FORMAT label 1120 at (1) not defined
f951: some warnings being treated as errors
make[2]: *** [Makefile:42: remap_conserv.o] Error 1


It seems that When try to make compile makescrip it showing fortran formating error. 

Thank you.

Posted by Anonymous at March 16 2024

Yo,

the "Error: Line truncated at (1) [-Werror=line-truncation]" points to a line in the code that's too long for your compiler's taste, usually set to a max of 132 characters for gfortran. You can remove this limit by adding the compiler flag -ffree-line-length-none and see whether the error is gone. All other errors seem to be a consequence of the truncation. See the link below for more info: 

https://stackoverflow.com/questions/19311766/gfortran-line-length-limit

After 4 months I assume that you either figured it out or [EDITED], but just in case someone else from the future finds themself in a similar situation.

Love,
Jorjo, from the past.
Reply to this